home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 031a / wedl110.zip / WEDL.DOC < prev    next >
Text File  |  1991-11-21  |  141KB  |  3,865 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.                 +----------------------------------------------+
  14.                 |                                              |
  15.                 |      W          W  EEEEE  DDDD    LL         |
  16.                 |      WW        WW  EE     DD  D   LL         |
  17.                 |       WW  WW  WW   EEEE   DD   D  LL         |
  18.                 |        WW WW WW    EE     DD  D   LL         |
  19.                 |         WW  WW     EEEEE  DDDD    LLLLLL     |
  20.                 |                                              |
  21.                 |                                              |
  22.                 |        Windows Enhanced Dialog Library       |
  23.                 |                                              |
  24.                 |                                              |
  25.                 |             Programmer's Manual              |
  26.                 |                                              |
  27.                 |                                              |
  28.                 |      Copyright (c) 1991, Mike Smedley        |
  29.                 |                                              |
  30.                 |             All Rights Reserved              |
  31.                 |                                              |
  32.                 |                                              |
  33.                 |               Version 1.10                   |
  34.                 |                                              |
  35.                 |             November 21, 1991                |
  36.                 |                                              |
  37.                 +----------------------------------------------+
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.                                       1    
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.                                 SOFTWARE LICENSE
  67.  
  68.     This evaluation version of WEDL may be distributed, only in its
  69.     entirety, for others to evaluate.  None of the evaluation files may be
  70.     modified or deleted.  The evaluation version of the WEDL dynamic-link
  71.     library (file name WEDL-E.DLL) cannot be distributed with applications
  72.     built that use it.  This requires registration of the software.
  73.  
  74.     Software distribution companies that distribute user-supported software
  75.     may distribute this evaluation version of WEDL and charge a disk copying
  76.     fee not to exceed $10.00 in U.S. currency.
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.                                    DISCLAIMER
  84.  
  85.     The author of this software package, Mike Smedley, has used his best
  86.     efforts in producing this software and documentation.  These efforts
  87.     include the research, development, and testing of the software, and
  88.     production of the documentation.
  89.  
  90.     The author makes no warranty of any kind, expressed or implied, with
  91.     regards to the software or the documentation.  The author shall not be
  92.     liable in any event for incidental or consequential damages in
  93.     connection with, or arising out of, the furnishing, performance, or use
  94.     of this software package.
  95.  
  96.     All pricing subject to change without notice.
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.                                       2    
  113.  
  114.  
  115.                                TABLE OF CONTENTS
  116.  
  117.  
  118.     Acknowledgements.....................................................6
  119.     Introduction.........................................................7
  120.     Welcome to WEDL!.....................................................8
  121.     WEDL Features........................................................8
  122.     System Requirements..................................................10
  123.     Archive Contents.....................................................10
  124.     Registration Information.............................................11
  125.     WEDL Registration Form...............................................12
  126.     Contacting the Author................................................13
  127.     Version History......................................................13
  128.     Programming Guide....................................................14
  129.     Terminology..........................................................15
  130.     Naming Conventions...................................................15
  131.     How WEDL Fields Work.................................................15
  132.     Creating the Dialog Box..............................................16
  133.     Layout of the Dialog Procedure.......................................16
  134.     Defining the Form....................................................17
  135.     Defining Fields......................................................18
  136.     Defining Buttons.....................................................18
  137.     Defining Generic Controls............................................19
  138.     Defining Status Messages.............................................20
  139.     Writing Field Validation Functions...................................20
  140.     Writing Error Handlers...............................................21
  141.     Defining Context-Sensitive Help......................................21
  142.     Compiling and Linking................................................22
  143.     Executing the Program................................................22
  144.     Common Programming Errors............................................22
  145.     Function Reference...................................................25
  146.     button_define........................................................26
  147.     button_get_check.....................................................27
  148.     button_get_from_ctrl_id..............................................27
  149.     button_get_from_group................................................28
  150.     button_get_from_hwnd.................................................28
  151.     button_has_changed...................................................28
  152.     button_lock..........................................................29
  153.     button_set_check.....................................................29
  154.     button_unlock........................................................30
  155.     char_is_printable....................................................30
  156.     char_to_lower........................................................30
  157.     char_to_upper........................................................31
  158.     dproc_enter_error....................................................31
  159.     dproc_enter_idcancel.................................................31
  160.     dproc_enter_idok.....................................................31
  161.     dproc_enter_wm_command...............................................32
  162.     dproc_exit_error.....................................................32
  163.     field_data_to_log....................................................33
  164.     field_define.........................................................33
  165.     field_disable_feature................................................38
  166.  
  167.  
  168.                                       3    
  169.     field_enable_feature.................................................38
  170.     field_get_character..................................................39
  171.     field_get_decimal_pos................................................39
  172.     field_get_from_ctrl_id...............................................39
  173.     field_get_from_hwnd..................................................40
  174.     field_get_pos_info...................................................40
  175.     field_get_position...................................................41
  176.     field_get_text.......................................................41
  177.     field_has_changed....................................................41
  178.     field_insert_decimal.................................................42
  179.     field_lock...........................................................42
  180.     field_log_to_data....................................................43
  181.     field_log_to_phys....................................................43
  182.     field_phys_to_log....................................................44
  183.     field_set_text.......................................................44
  184.     field_unlock.........................................................44
  185.     form_begin...........................................................45
  186.     form_end.............................................................45
  187.     form_get_active......................................................45
  188.     form_get_from_hdlg...................................................46
  189.     form_has_changed.....................................................46
  190.     form_in_error_cond...................................................46
  191.     form_is_cancelled....................................................47
  192.     form_lock............................................................47
  193.     form_process.........................................................48
  194.     form_set_help........................................................48
  195.     form_terminate.......................................................49
  196.     form_unlock..........................................................49
  197.     form_validate........................................................49
  198.     genctrl_define.......................................................50
  199.     statmsg_define.......................................................50
  200.     str_delete_char......................................................51
  201.     str_insert_char......................................................52
  202.     str_is_blank.........................................................52
  203.     str_is_value_zero....................................................52
  204.     str_trim_spaces......................................................53
  205.     Data Type Reference..................................................54
  206.     BUTTON...............................................................55
  207.     FIELD................................................................56
  208.     FIELD_POS............................................................57
  209.     FORM.................................................................58
  210.     HBUTTON..............................................................61
  211.     HFIELD...............................................................61
  212.     HFORM................................................................61
  213.     HGENCTRL.............................................................61
  214.     LPBUTTON.............................................................61
  215.     LPFIELD..............................................................61
  216.     LPFIELD_POS..........................................................62
  217.     LPFORM...............................................................62
  218.     PBUTTON..............................................................62
  219.     PFIELD...............................................................62
  220.     PFIELD_POS...........................................................62
  221.     PFORM................................................................62
  222.  
  223.  
  224.                                       4    
  225.     PROC_ARRAY_INFO......................................................62
  226.     Appendix A:  Picture String Characters...............................64
  227.     Appendix B:  Field Editing Keys......................................66
  228.     Appendix C:  Glossary................................................68
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.                                       5    
  281.  
  282.  
  283.  
  284.     Acknowledgements
  285.  
  286.     BIX is a registered trademark of McGraw-Hill, Inc.
  287.     Borland is a registered trademark of Borland International.
  288.     CompuServe is a registered trademark of CompuServe, Inc.
  289.     IBM is a registered trademark of International Business Machines.
  290.     Microsoft is a registered trademark of the Microsoft Corporation.
  291.     MS-DOS is a registered trademark of the Microsoft Corporation.
  292.     Windows is a trademark of the Microsoft Corporation.
  293.  
  294.     This manual was written using Microsoft Word for Windows.
  295.     This manual was printed on a Hewlett-Packard LaserJet IIP.
  296.     The software was written using SemWare's QEdit text editor.
  297.     The resources for the demo program were created using Borland's Resource
  298.     Workshop.
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.                                       6    
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.                                 Introduction
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.                                       7    
  393.  
  394.  
  395.     Welcome to WEDL!
  396.  
  397.     Welcome to WEDL, the Windows Enhanced Dialog Library.  WEDL (pronounced
  398.     "weddle") is a collection of C functions for Microsoft Windows
  399.     programmers designed to make dialog box data entry much easier for both
  400.     the programmer and the user.
  401.  
  402.  
  403.     WEDL Features
  404.  
  405.     Enhanced Edit Fields
  406.  
  407.         Formatted Data Entry
  408.  
  409.             Picture strings are assigned to fields which describe the
  410.             allowable characters for each field position and specify the
  411.             position of formatting characters which aid the user in
  412.             correctly entering data.  For example, a telephone number field
  413.             could visually look like "(___)___-____" instead of just
  414.             "__________".  The user is not able to move the cursor to, or
  415.             edit, the embedded formatting characters.
  416.  
  417.         Field Validation
  418.  
  419.             Extensive field validation is provided via WEDL's own internal
  420.             validations and optionally through programmer-written validation
  421.             functions.  Validation is provided internally by picture strings
  422.             which describe the allowable characters for each field position,
  423.             and optional field validations such as Field Cannot Be Blank,
  424.             Field Cannot Be Zero, and Field Cannot Be Edited.  In addition,
  425.             you can write validation functions to perform any other needed
  426.             validations.  The user is not able to leave the field or select
  427.             "OK" until the field passes validation.
  428.  
  429.         Automatic Reading and Writing of Variables
  430.  
  431.             WEDL can automatically read and write your program's variables,
  432.             placing their contents into the fields for updating, then
  433.             storing the contents of the fields back to the variables upon
  434.             completion of the form.  Data type conversion is performed
  435.             on-the-fly.  This saves you from having to set and get the
  436.             contents of the fields and convert between data types.  The data
  437.             types supported by WEDL fields include character string, int,
  438.             unsigned, long, unsigned long, and double.
  439.  
  440.         Numeric Data Entry
  441.  
  442.             Numeric data entry is fully supported by WEDL.  There is a
  443.             standard numeric field which supports left-to-right digit input
  444.             and a decimal point. In addition, there is a calculator-style
  445.             numeric field which supports right-to-left digit input, a
  446.  
  447.  
  448.                                       8    
  449.             decimal point, and optional commas which appear only when a
  450.             digit precedes them (eg. the user would see "1,000.00" instead
  451.             of "1000.00").
  452.  
  453.         Overtype Mode
  454.  
  455.             WEDL fields provide an overtype mode in addition to the insert
  456.             mode Windows' edit fields provide.
  457.  
  458.         Case Conversion
  459.  
  460.             WEDL can automatically convert letters entered into a field to
  461.             uppercase or lowercase.  Also, there is a mixed-case option
  462.             which converts characters to uppercase or lowercase depending on
  463.             the previous character (eg. "Mixed Case").  Foreign alphabetic
  464.             characters are supported.
  465.  
  466.         Enhanced Editing Keys
  467.  
  468.             In addition to the editing keys available in Windows' edit
  469.             fields, WEDL provides a variety of new editing keys.  See
  470.             Appendix B for a list of editing keys.
  471.  
  472.     Enhanced Radio Buttons and Check Boxes
  473.  
  474.         Automatic Reading and Writing of Variables
  475.  
  476.             WEDL can automatically read and write your program's variables,
  477.             setting radio buttons and check boxes according to the
  478.             variables' values, then when the form is finished, the variables
  479.             are updated to specified values indicating whether the buttons
  480.             or check boxes are checked or not.  For a group of radio buttons
  481.             within a group box, a variable can automatically be set to a
  482.             value indicating which button in the group was checked.
  483.  
  484.     Enhanced Combo Boxes
  485.  
  486.         The edit fields in combo boxes have the same features as standard
  487.         edit fields, in addition to the ability to interact with the combo
  488.         box's list box.
  489.  
  490.     Context-Sensitive Help
  491.  
  492.         Context-sensitive help can easily be applied to individual fields,
  493.         radio buttons, check boxes, combo boxes, or any other control within
  494.         a dialog box.  When the user presses the F1 key, the Windows Help
  495.         application will be run and help information for the current control
  496.         will be displayed.
  497.  
  498.     Dynamic-Link Library
  499.  
  500.         WEDL's functions are contained in a Windows dynamic-link library.
  501.         The .DLL library format has many advantages over the normal .LIB
  502.  
  503.  
  504.                                       9    
  505.         format.  These include:
  506.  
  507.             The dynamic-link library will be loaded only once into memory,
  508.             no matter how many running applications use it.
  509.  
  510.             There is no need for multiple memory model versions of the
  511.             library.  No matter which memory model your program is written
  512.             in, it still uses the same dynamic-link library.
  513.  
  514.             The dynamic-link library is not compiler-specific.  Any C or C++
  515.             compiler that supports the creation of Windows applications will
  516.             be able to use WEDL.  Other language compilers that can produce
  517.             Windows applications may also be compatible with WEDL.
  518.  
  519.     Compatibility
  520.  
  521.         Since WEDL's functions are contained in a dynamic-link library, any
  522.         C or C++ compiler that supports the creation of Windows applications
  523.         will be able to use WEDL.
  524.  
  525.         WEDL does not replace Windows' dialog controls; it extends their
  526.         capabilities by subclassing them. Therefore WEDL is compatible with
  527.         all resource editors and CASE products that produce resource files.
  528.  
  529.         WEDL is compatible with foreign languages supported by Windows'
  530.         language driver.
  531.  
  532.  
  533.     System Requirements
  534.  
  535.     Microsoft Windows version 3.0 or greater (real, standard, or enhanced
  536.     mode). MS-DOS version 3.1 or greater.
  537.  
  538.     Microsoft Windows Software Development Kit or compatible tools.
  539.  
  540.     To use the WEDL library:
  541.         Any C or C++ compiler capable of producing Windows programs.  Other
  542.         language compilers may or may not be compatible.
  543.  
  544.     To rebuild the WEDL library:
  545.         Microsoft C 6.0 and Borland C++ 2.0 have been successfully tested.
  546.         Other C or C++ compilers may work as well.
  547.  
  548.  
  549.     Archive Contents
  550.  
  551.     The contents of the WEDL___.ZIP archive file are as follows:
  552.  
  553.     File Name       Description
  554.     ---------       -----------
  555.     DEMO.DEF        Demonstration program module definition file.
  556.     DEMO.EXE        Demonstration program executable file.
  557.     DEMO.H          Demonstration program header file.
  558.  
  559.  
  560.                                       10   
  561.     DEMO.ICO        Application icon for the demonstration program.
  562.     DEMO.MAK        Demonstration program make file.
  563.     DEMO.RC         Demonstration program resource source file.
  564.     DEMO?.C         Demonstration program source code files.
  565.     DEMOHELP.H      Header file containing demonstration program help
  566.                     definitions.
  567.     DEMOHELP.HLP    Demonstration program help file.
  568.     DEMOHELP.HPJ    Project file for the demonstration program's help file.
  569.     DEMOHELP.RTF    Source text for demonstration program's help file.
  570.     READ.ME         Contains last-minute updates and other important
  571.                     information.
  572.     REGISTER.DOC    Information about registering WEDL.
  573.     WEDL.DOC        WEDL documentation file.  (You are reading it now.)
  574.     WEDL-E.DLL      WEDL dynamic-link library.
  575.     WEDL.H          WEDL header file.
  576.     WEDL-E.LIB      WEDL import library.
  577.  
  578.  
  579.     Registration Information
  580.  
  581.     WEDL is a user-supported software product.  This means you are free to
  582.     try the software long enough to evaluate it and see if it meets your
  583.     needs. After a reasonable evaluation period, you are expected to either
  584.     register the software or cease using it.  Registering the software gives
  585.     you many benefits including:
  586.  
  587.         --  Unrestricted WEDL.DLL library.  The evaluation version
  588.             (WEDL-E.DLL) restricts the number of controls that can be
  589.             defined per form to 12.  (The "OK" and "Cancel" buttons each
  590.             count as a defined control.)
  591.  
  592.         --  The full library source code.
  593.  
  594.         --  A high-quality printed manual.
  595.  
  596.         --  Royalty-free distribution of the WEDL.DLL library.  The
  597.             evaluation version, WEDL-E.DLL, cannot be distributed.
  598.  
  599.         --  Unlimited technical support via E-mail or postal mail.
  600.  
  601.  
  602.  
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.                                       11   
  617.  
  618.                               WEDL REGISTRATION FORM
  619.  
  620.  
  621.     NAME:___________________________________________________________________
  622.  
  623.  
  624.     COMPANY:________________________________________________________________
  625.  
  626.  
  627.     ADDRESS:________________________________________________________________
  628.  
  629.  
  630.     ________________________________________________________________________
  631.  
  632.  
  633.     CITY, STATE:____________________________________________________________
  634.  
  635.  
  636.     ZIP CODE: ____________________________  COUNTRY:________________________
  637.  
  638.  
  639.     TELEPHONE NUMBER:___________________  DISK SIZE:   5.25"    /    3.5"
  640.  
  641.  
  642.     WHERE DID YOU RECEIVE WEDL?_____________________________________________
  643.  
  644.  
  645.     WEDL Registration @ $55.00 per copy                        _____________
  646.  
  647.     Shipping and Handling
  648.     (U.S.A. and Canada = $5.00,  Overseas = $10.00) per copy   _____________
  649.  
  650.  
  651.     Florida Residents, Add 7% State Sales Tax ($4.20) per copy _____________
  652.  
  653.  
  654.     Total Amount Enclosed:                                     _____________
  655.  
  656.  
  657.     Payment must be with a check or money order payable in U.S. dollars and
  658.     drawn on a U.S. bank.  Make checks payable to Mike Smedley.
  659.  
  660.     Purchase orders are accepted from Fortune 500, government, or
  661.     educational institutions ONLY for orders of 3 copies or more.
  662.  
  663.     To register WEDL, send the above information and payment to:
  664.  
  665.             Mike Smedley
  666.             P.O. Box 17325
  667.             Jacksonville, FL 32245-7325
  668.  
  669.  
  670.  
  671.  
  672.                                       12   
  673.  
  674.     Contacting the Author
  675.  
  676.     The author, Mike Smedley, can be contacted via one of the following
  677.     methods:
  678.  
  679.         Electronic Mail:
  680.             BIX:            m.smedley
  681.             CompuServe:     71331,2244
  682.  
  683.         Postal Mail:
  684.             Mike Smedley
  685.             P.O. Box 17325
  686.             Jacksonville, FL  32245-7325
  687.  
  688.     Electronic mail is the fastest and most reliable way to get technical
  689.     support.  If enough interest is expressed in WEDL, a bulletin board
  690.     system (BBS) may be established to provide even greater technical
  691.     support.
  692.  
  693.  
  694.     Version History
  695.  
  696.     Version     Date            Description
  697.     -------     ----            -----------
  698.     1.10        Nov. 21, 1991   Modified to allow the cursor to move past
  699.                                 the last editable position. This also fixes
  700.                                 a scrolling bug in ES_AUTOHSCROLL fields.
  701.  
  702.                                 The 'F' and 'P' validation characters now
  703.                                 have more informative "invalid character"
  704.                                 messages.
  705.  
  706.                                 Fixed bug where FDF_CONDUPD and
  707.                                 FDF_CALCNUM fields sometimes wouldn't match
  708.                                 the validation character properly.
  709.  
  710.     1.01        Nov. 11, 1991   Fixed bug where changing a check box's value
  711.                                 would not update its "has changed" flag.
  712.                                 This bug affected the form_has_changed and
  713.                                 button_has_changed functions.
  714.  
  715.     1.00        Oct. 14, 1991   Initial release.
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.                                       13   
  729.  
  730.  
  731.  
  732.  
  733.  
  734.  
  735.  
  736.  
  737.  
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.  
  749.  
  750.  
  751.  
  752.  
  753.  
  754.  
  755.                                Programming Guide
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.                                       14   
  785.  
  786.  
  787.     Terminology
  788.  
  789.     There are several terms that are used throughout this manual that are
  790.     important to understand.  Consult the Glossary in the back of this
  791.     manual for the definition of any terms you do not understand.
  792.  
  793.  
  794.     Naming Conventions
  795.  
  796.     Function Naming
  797.  
  798.         WEDL's functions are named in an object-oriented manner.  The first
  799.         part of the function name is the prefix which identifies the type of
  800.         object the function operates on.  The second part of the function
  801.         name identifies the action to perform on the object.  The following
  802.         is a list of prefixes used by WEDL functions:
  803.  
  804.         Prefix          Meaning
  805.         ------          -------
  806.         button_         Function operates on a button.
  807.         char_           Function operates on a character.
  808.         dproc_          Function operates on the dialog procedure.
  809.         field_          Function operates on a field.
  810.         form_           Function operates on a form.
  811.         genctrl_        Function operates on a generic control.
  812.         statmsg_        Function operates on a key status message.
  813.         str_            Function operates on a character string.
  814.  
  815.     Data Type and Variable Naming
  816.  
  817.         Data type and variable naming in WEDL is fairly consistent.  The
  818.         prefix 'h' is used for data types and variables corresponding to
  819.         handles.  The prefix 'p' is used for data types and variables
  820.         corresponding to pointers (not specifying near or far).  The prefix
  821.         'lp' is used for data types and variables corresponding to far
  822.         pointers.
  823.  
  824.  
  825.     How WEDL Fields Work
  826.  
  827.     WEDL fields may have embedded formatting characters in them in order to
  828.     assist the user in correctly inputting the required data.  For example,
  829.     the '(', ')', and '-' characters in a phone number field are considered
  830.     formatting characters.  Also there are special formatting characters
  831.     such as the commas and decimal point in numeric fields.  The user is not
  832.     able to move the cursor to, or edit, the formatting characters.
  833.     Formatting characters are not copied to the destination by default.
  834.  
  835.     Fields that contain embedded formatting characters are considered to be
  836.     in physical field format.  If you were to call the GetDlgItemText
  837.     function, you would get the field's physical contents.  Fields that do
  838.  
  839.  
  840.                                       15   
  841.     not contain embedded formatting characters are considered to be in
  842.     logical field format.
  843.  
  844.     When defining a field, the data type of the associated variable is
  845.     converted to a character string in physical field format and this string
  846.     is used to set the contents of the field.  When the user selects "OK",
  847.     the field's contents are converted back to the data types of their
  848.     variables and stored.
  849.  
  850.  
  851.     Creating the Dialog Box
  852.  
  853.     When creating a dialog box to be used with WEDL, very few special
  854.     considerations are needed.  You use your dialog box resource editor as
  855.     normal.  For edit controls to be defined as WEDL fields, you should
  856.     specify the WS_TABSTOP, WS_BORDER, WS_CHILD, ES_LEFT, and ES_AUTOHSCROLL
  857.     styles. For edit controls that belong to a combo box, use
  858.     CBS_AUTOHSCROLL instead of ES_AUTOHSCROLL.
  859.  
  860.     For radio buttons and check boxes, you should specify the
  861.     BS_AUTORADIOBUTTON or BS_AUTOCHECKBOX styles respectively.  If the check
  862.     box is a 3-state check box, use BS_AUTO3STATE.
  863.  
  864.     If you desire to have an automatically-updated Insert, CapsLock, or
  865.     NumLock key status message in your dialog box, place a static text
  866.     control for each message where you want the message to appear in the
  867.     dialog box.  The static text control must be wide enough to display the
  868.     entire status message.
  869.  
  870.     When assigning control IDs to the controls in the dialog box, avoid
  871.     using values 27700 - 27799.  These values are reserved by WEDL.
  872.  
  873.  
  874.     Layout of the Dialog Procedure
  875.  
  876.     The dialog procedure is where all definition and processing of the form
  877.     occur.  The layout of the dialog procedure is as follows:
  878.  
  879.     int FAR PASCAL DialogProc( HWND hDlg, unsigned message, WORD wParam,
  880.                                LONG lParam )
  881.     {
  882.         static HFORM hform = NULL;      /* must be static or global! */
  883.  
  884.         switch( message ) {
  885.  
  886.             case WM_INITDIALOG:
  887.                 /* Do not call any Windows functions that generate */
  888.                 /* WM_COMMAND messages before defining the form!   */
  889.                 hform = form_begin( hDlg );
  890.                 /* Call field_define() for each field to be defined. */
  891.                 /* Call button_define() for each button to be defined. */
  892.                 /* Call genctrl_define() for each generic control. */
  893.                 /* Call statmsg_define() for each status message. */
  894.  
  895.  
  896.                                       16   
  897.                 form_end( hform );
  898.                 /* Perform any other WM_INITDIALOG processing. */
  899.                 return( TRUE );
  900.  
  901.             case WM_COMMAND:
  902.                 dproc_enter_wm_command( hform, wParam, lParam );
  903.                 switch( wParam ) {
  904.  
  905.                     /* Add a case statement for each error value */
  906.                     /* given in your calls to field_define().    */
  907.  
  908.                     case MY_ERROR_VALUE:    /* defined by the programmer */
  909.                         dproc_enter_error( hform );
  910.                         /* display error message, etc. */
  911.                         dproc_exit_error( hform, lParam );
  912.                         return( TRUE );
  913.  
  914.                     case IDOK:
  915.                         dproc_enter_idok( hform );
  916.                         if( !form_in_error_cond( hform ) ) {
  917.                             if( form_validate( hform ) != NULL ) break;
  918.                                 form_process( hform );
  919.                                 EndDialog( hDlg, TRUE );
  920.                                 form_terminate( hform );
  921.                                 /* Perform other IDOK processing. */
  922.                         }
  923.                         return( TRUE );
  924.  
  925.                     case IDCANCEL:
  926.                         dproc_enter_idcancel( hform );
  927.                         EndDialog( hDlg, TRUE );
  928.                         form_terminate( hform );
  929.                         /* Perform other IDCANCEL processing. */
  930.                         return( TRUE );
  931.                 }
  932.                 break;
  933.         }
  934.         return( FALSE );
  935.     }
  936.  
  937.  
  938.     Defining the Form
  939.  
  940.     The definition of a form is performed during WM_INITDIALOG message
  941.     processing in the dialog procedure.  The form_begin and form_end
  942.     functions are required for form definition.  The functions used to
  943.     define controls within the form are field_define, button_define,
  944.     genctrl_define and statmsg_define. These functions define fields,
  945.     buttons, generic controls, and status messages respectively.  The calls
  946.     to these functions must be made between form_begin and form_end.
  947.  
  948.     It is recommended that form_begin be called immediately upon entry into
  949.     WM_INITDIALOG.  If you call any Windows function which generate
  950.  
  951.  
  952.                                       17   
  953.     WM_COMMAND messages before the form is defined, the form handle returned
  954.     by form_begin will not be valid and any WM_COMMAND message processing
  955.     which relies on a valid form handle will fail.
  956.  
  957.     If you are planning on adding context-sensitive help to individual
  958.     controls, you will need to call the form_set_help function somewhere
  959.     after form_begin.  The form_set_help function sets the Windows Help file
  960.     name that will be used for context-sensitive help.
  961.  
  962.  
  963.     Defining Fields
  964.  
  965.     A field is an edit control within your dialog box and is usually of
  966.     class "edit".  To define a field, you must call the field_define
  967.     function for a given edit control.  Not all edit controls have to be
  968.     defined, but if you want them to have WEDL field capabilities, you
  969.     should define them.  The purpose of defining a field is to:
  970.  
  971.         1.  Assign a picture string to the field.  The picture string
  972.         defines the size of the field, the allowable characters for each
  973.         field position, and the placement of formatting characters in the
  974.         field.  See Appendix A for a list of characters that can be used in
  975.         picture strings.
  976.  
  977.         2.  Optionally assign a variable to the field.  The variable can be
  978.         initialized or updated by the field.
  979.  
  980.         3.  Optionally specify various behavioral features of the field.
  981.         Such features include numeric formatting, case conversion, space
  982.         padding, and whether the field belongs to a combo box. See the
  983.         description of the field_define function for a list of features that
  984.         can be specified.
  985.  
  986.         4.  Optionally assign a validation function to the field.  The
  987.         validation function is written by you, the programmer, to validate
  988.         the contents of the field.  See the section on writing field
  989.         validation functions below for more information.
  990.  
  991.         5.  Optionally assign a Windows Help context to the field.  If the
  992.         user presses F1 in the field, a help screen will be displayed with
  993.         information on that particular field.  See the section on defining
  994.         context-sensitive help for more information.
  995.  
  996.     The following is an example of a call to field_define:
  997.  
  998.         field_define( hform, ID_ACCTNO, &acct_no, DT_INTEGER, "###",
  999.                       FDF_NUMERIC | FDF_NOTZERO, pcheck_acct_num,
  1000.                       BAD_ACCTNO, HELPID_ACCTNO );
  1001.  
  1002.  
  1003.     Defining Buttons
  1004.  
  1005.     A button is a control within your dialog box that typically has an on or
  1006.  
  1007.  
  1008.                                       18   
  1009.     off state.  The control is usually of class "button" and can be a radio
  1010.     button, check box, or compatible button.  To define a button, you must
  1011.     call the button_define function for a given button control.  Not all
  1012.     button controls have to be defined, but if you want them to have WEDL
  1013.     button capabilities, you should define them.  The purpose of defining a
  1014.     button is to:
  1015.  
  1016.         1.  Optionally assign a variable to the button.  The variable can be
  1017.         set to a value indicating whether the button has been checked or not
  1018.         checked.  The variable can also be set to a value indicating which
  1019.         button in a group of buttons was checked.
  1020.  
  1021.         2.  Optionally initialize the state of the button.  The button can
  1022.         be initialized on, off, grayed (disabled), or can be set according
  1023.         to the value of the variable assigned to the button.
  1024.  
  1025.         3.  Optionally assign a Windows Help context to the button.  If the
  1026.         user presses F1 while on the button, a help screen will be displayed
  1027.         with information on that particular button.  See the section on
  1028.         defining context-sensitive help for more information.
  1029.  
  1030.     Do not use button_define to define a push button.  Since a push button
  1031.     only has an instantaneous "on" state, assigning a variable to the button
  1032.     would be useless.  Use the genctrl_define function for defining push
  1033.     buttons.  The "OK" and "Cancel" buttons are defined by default because
  1034.     WEDL needs to maintain them.
  1035.  
  1036.     The following is an example of a call to button_define where the button
  1037.     is not part of a group:
  1038.  
  1039.         button_define( hform, ID_SAVECHANGES, &bSaveChanges, 0, TRUE, FALSE,
  1040.                        BS_OFF, HELPID_SAVECHANGES );
  1041.  
  1042.     The following calls to button_define demonstrate the definition of a
  1043.     group of 3 related buttons:
  1044.  
  1045.         button_define( hform, ID_XMODEM, &protocol, 1, ID_XMODEM, 0,
  1046.                        BS_USEDATA, HELPID_XMODEM );
  1047.         button_define( hform, ID_YMODEM, &protocol, 1, ID_YMODEM, 0,
  1048.                        BS_USEDATA, HELPID_YMODEM );
  1049.         button_define( hform, ID_ZMODEM, &protocol, 1, ID_ZMODEM, 0,
  1050.                        BS_USEDATA, HELPID_ZMODEM );
  1051.  
  1052.  
  1053.     Defining Generic Controls
  1054.  
  1055.     A generic control can be any control within your dialog box.  It is
  1056.     usually a list box, push button, or custom control.  To define a generic
  1057.     control, you must call the genctrl_define function for a given dialog
  1058.     box control.  The only reasons for defining a generic control are to
  1059.     assign context-sensitive help to it, and to make sure that status
  1060.     messages get updated if the Insert, CapsLock, or NumLock keys are
  1061.     pressed while the control has input focus.
  1062.  
  1063.  
  1064.                                       19   
  1065.  
  1066.     The following is an example of a call to genctrl_define:
  1067.  
  1068.         genctrl_define( hform, ID_LISTBOX, HELPID_LISTBOX );
  1069.  
  1070.  
  1071.     Defining Status Messages
  1072.  
  1073.     In many circumstances, it is desirable to have a status message
  1074.     indicating whether the Insert, CapsLock, or NumLock key is toggled on or
  1075.     off.  WEDL provides a simple method for creating these automatically-
  1076.     updated key status messages.  All you have to do is define a static text
  1077.     control (class "static") in your dialog box to be used for the
  1078.     displaying of the status message.  Then call the statmsg_define function
  1079.     to link the key to the status message.
  1080.  
  1081.     The only drawbacks to these types of status messages is they cannot be
  1082.     updated while the input focus is set to a control not defined by WEDL.
  1083.     When the user moves to a control that has been defined by WEDL, the
  1084.     status message will be updated.
  1085.  
  1086.  
  1087.     Writing Field Validation Functions
  1088.  
  1089.     A field validation function is a function written by you, the
  1090.     programmer, to validate the information in a field. The validation
  1091.     function is called both when the user tries to leave the field and when
  1092.     the user selects "OK". The exception to this rule is when the field has
  1093.     the FDF_VAFFRM feature specified, in which case the validation function
  1094.     is called only when the user selects "OK".  A validation function is
  1095.     assigned to a field by the field_define function.  The validation
  1096.     function must be declared in this form:
  1097.  
  1098.         int FAR PASCAL ValidationFunc( LPSTR pbuf );
  1099.  
  1100.     Since the validation function is a callback function, it must be
  1101.     declared FAR and have an entry in the EXPORTS section of your
  1102.     application's module definition file.
  1103.  
  1104.     The validation function is passed a pointer to a temporary buffer
  1105.     containing a character string in logical field format.  You use this
  1106.     character string to validate the field.  If you need to convert the
  1107.     value to a numeric data type, you can use the field_log_to_data function
  1108.     to do so.  You may also use the atoi, atol, or field_insert_dec/atof
  1109.     functions for converting the string to a numeric data type.
  1110.  
  1111.     When you are done validating the field's contents, you return either
  1112.     zero if the field contains no errors or the position of the error in the
  1113.     field + 1.
  1114.  
  1115.     The following is an example of a validation function that checks an
  1116.     account number and makes sure it is within 100 and 400:
  1117.  
  1118.  
  1119.  
  1120.                                       20   
  1121.         int FAR PASCAL check_acct_num( LPSTR pbuf )
  1122.         {
  1123.             int acctno;
  1124.  
  1125.             acctno = atoi( pbuf );
  1126.             if( acctno < 100 || acctno > 400 ) return( 1 );
  1127.             return( 0 );
  1128.         }
  1129.  
  1130.     Use the validation function only for validating the field.  If you call
  1131.     Windows functions which generate messages, you chance crashing your
  1132.     program.  Modifying the contents of the temporary buffer will not change
  1133.     the contents of the field and is not recommended.
  1134.  
  1135.  
  1136.     Writing Error Handlers
  1137.  
  1138.     For every validation function, there is a corresponding error handler.
  1139.     The error handler is a piece of code that is responsible for displaying
  1140.     an error message, sounding a an audible beep, or any other actions you
  1141.     want to take in the event of an error.  WEDL takes care of repositioning
  1142.     the cursor to the position of the error in the field.
  1143.  
  1144.     The error handler is written in the dialog procedure.  The errval
  1145.     parameter you specified in the call to the field_define function is
  1146.     passed in the wParam parameter of the WM_COMMAND message.  You must call
  1147.     the dproc_enter_error function immediately upon entry into the error
  1148.     handler and dproc_exit_error just before leaving the error handler.  The
  1149.     error handler returns TRUE indicating the dialog procedure handled the
  1150.     message.
  1151.  
  1152.     The following is an example error handler:
  1153.  
  1154.         case BAD_ACCTNO:
  1155.             dproc_enter_error( hform );
  1156.             MessageBeep( 0 );
  1157.             MessageBox( hDlg, "Account number is invalid!", NULL, MB_OK );
  1158.             dproc_exit_error( hform, lParam );
  1159.             return( TRUE );
  1160.  
  1161.  
  1162.     Defining Context-Sensitive Help
  1163.  
  1164.     Context-sensitive help can be applied to controls defined by WEDL.  WEDL
  1165.     uses the standard Windows Help application and F1 key in its
  1166.     implementation.  First you must call the form_set_help function to let
  1167.     WEDL know you'll be using context-sensitive help and to specify the name
  1168.     of the Windows Help file that will be used.  You should call this
  1169.     function somewhere in the dialog procedure's WM_INITDIALOG message
  1170.     processing after form_begin has been called.
  1171.  
  1172.     In the field_define, button_define, and genctrl_define function calls,
  1173.     one of the parameters, help_context, is used to specify the context ID
  1174.  
  1175.  
  1176.                                       21   
  1177.     of the Windows Help topic associated with the control.  If the user
  1178.     presses F1 while in a control with a nonzero help_context, the Windows
  1179.     Help application will be executed.  Then Windows Help will automatically
  1180.     load the help file specified in the form_set_help function and display
  1181.     the topic for the control's help_context.
  1182.  
  1183.     To create a Windows Help file, you'll need a word processing program
  1184.     capable of producing Rich Text Format (.RTF) files and the help compiler
  1185.     included in the Microsoft Windows Software Development Kit. There is
  1186.     plenty of information on this in the Windows SDK documentation, so there
  1187.     is no need to cover this here.
  1188.  
  1189.  
  1190.     Compiling and Linking
  1191.  
  1192.     To create programs that use WEDL, you need the WEDL.H header file, the
  1193.     WEDL-E.DLL library file, and the WEDL-E.LIB import library file.
  1194.  
  1195.     First, you must first compile the source code file(s) into object code
  1196.     file(s).  Sample compiler command lines are:
  1197.  
  1198.         cl -c -AS -Gsw -Ox -Zpe -W3 demo.c
  1199.         bcc -c -ms -w -WS -O -Z demo.c
  1200.  
  1201.     Second, you must link object modules together to create an executable
  1202.     program.  Sample linker command lines are:
  1203.  
  1204.         link /NOD demo, demo, demo, libw slibcew wedl-e, demo
  1205.         tlink /Twe /v /n /c c0ws demo,demo,,cwins cs import maths \
  1206.                 wedl-e, demo
  1207.  
  1208.     Finally, you must bind your resources to your executable program using a
  1209.     resource compiler.  A sample resource compiler command line is:
  1210.  
  1211.         rc demo
  1212.  
  1213.  
  1214.     Executing the Program
  1215.  
  1216.     When executing your program that uses WEDL, the only requirement is that
  1217.     the library file WEDL-E.DLL be in the current directory or in the PATH.
  1218.  
  1219.  
  1220.     Common Programming Errors
  1221.  
  1222.     There are a few common programming errors when using the WEDL library.
  1223.     These include:
  1224.  
  1225.     1.  You have a field that is larger than the character string buffer
  1226.     receiving the fields contents.  For example, if you have a phone number
  1227.     field defined like so:
  1228.  
  1229.         char phone_num[10];             // error - not large enough!
  1230.  
  1231.  
  1232.                                       22   
  1233.         field_define( hform, ID_PHONE, phone_num, DT_STRING,
  1234.                       "'('999')'999'-'9999", FDF_NONE, NULL, 0, 0 );
  1235.  
  1236.     When the user selects "OK", WEDL will copy the contents of the field
  1237.     plus a terminating '\0' character to 'phone_num'.  This means 11
  1238.     characters will be copied to a character string buffer only 10
  1239.     characters wide.  Changing 'phone_num' to an array of 11 characters will
  1240.     fix this problem. Suppose your phone number field is defined like:
  1241.  
  1242.         char phone_num[11];             // error - not large enough!
  1243.         field_define( hform, ID_PHONE, phone_num, DT_STRING,
  1244.                       "'('999')'999'-'9999", FDF_WRPHYS, NULL, 0, 0 );
  1245.  
  1246.     Now you have the same problem, but in a different way.  Since the
  1247.     FDF_WRPHYS feature is being used, the formatting characters '(', ')',
  1248.     and '-' will be copied to 'phone_num' as well.  This means 'phone_num'
  1249.     must be 14 characters wide.
  1250.  
  1251.     2.  Your form handle variable is not declared properly.  The 'hform'
  1252.     variable must be static or global.  Otherwise, it may not work.  This
  1253.     declaration is a no-no:
  1254.  
  1255.         int FAR PASCAL DialogProc( HWND hDlg, unsigned message, WORD wParam,
  1256.                                    LONG lParam )
  1257.         {
  1258.             HFORM hform;            //  error - not static!
  1259.             // ....the rest of the code
  1260.  
  1261.     As soon as WM_INITDIALOG returns, the value of 'hform' will be lost and
  1262.     later when the dproc_enter_wm_command function is called, it will be
  1263.     passed an invalid form handle.  Either change the declaration of 'hform'
  1264.     to static or make 'hform' a global variable.
  1265.  
  1266.     3.  A call to the field_define function keeps failing.  This is most
  1267.     likely occurring because your field's picture string is invalid or is
  1268.     invalid for the given field feature(s).  Check the picture string
  1269.     against the allowable characters listed in Appendix A.
  1270.  
  1271.     4.  You have a field in update mode (FDF_UPDATE or FDF_CONDUPD) and are
  1272.     getting garbage characters in the fields.  For example:
  1273.  
  1274.         char ssn[10];
  1275.         field_define( hform, ID_SOCSEC, ssn, DT_STRING,
  1276.                       "999'-'99'-'9999", FDF_UPDATE, NULL, 0, 0 );
  1277.  
  1278.     Here you would have a problem.  The variable 'ssn' has not been
  1279.     initialized, yet you have the field in update mode.  The field would be
  1280.     initialized with whatever garbage contents 'ssn' happens to contain.
  1281.     Make sure the variables you are updating actually have valid values.
  1282.     Otherwise, do not use update mode.
  1283.  
  1284.     5.  Your program locks up while in your validation function.  This is
  1285.     most likely the result of you calling a Windows function which generates
  1286.  
  1287.  
  1288.                                       23   
  1289.     messages that get sent to either the dialog procedure or the edit
  1290.     control procedure.  Some Windows function calls will work during a
  1291.     validation function; others will not.  You will have to experiment for
  1292.     yourself.
  1293.  
  1294.     6.  The data type you specified in the data_type parameter of the
  1295.     field_define function does not match the data type pointed to by the
  1296.     pdata pointer.  For example:
  1297.  
  1298.         long age;
  1299.         field_define( hform, ID_AGE, &age, DT_INTEGER,
  1300.                       "999", FDF_NONE, NULL, 0, 0 );
  1301.  
  1302.     Here the address of 'age', which is a long, is passed to field_define,
  1303.     yet the data_type was specified as an integer.  This will cause real
  1304.     problems.
  1305.  
  1306.     7.  You defined a combo box field without specifying FDF_COMBO as one of
  1307.     the field's features. The field will not function properly unless
  1308.     FDF_COMBO is specified.
  1309.  
  1310.     8.  You have a combo box field with formatting characters in the picture
  1311.     string.  Normally, the only characters that you should have in a picture
  1312.     string for a combo box field are validation characters. If you do use
  1313.     formatting characters, the strings contained in the combo box's list box
  1314.     must have the same format as the picture string.
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.  
  1328.  
  1329.  
  1330.  
  1331.  
  1332.  
  1333.  
  1334.  
  1335.  
  1336.  
  1337.  
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343.  
  1344.                                       24   
  1345.  
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.                               Function Reference
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396.  
  1397.  
  1398.  
  1399.  
  1400.                                       25   
  1401.  
  1402.     button_define
  1403.  
  1404.     Syntax      HBUTTON    button_define(hform, ctrl_id, pdata, group_id,
  1405.                 on_value, off_value, init_state, help_context)
  1406.  
  1407.                 Defines a button.
  1408.  
  1409.                 Parameter       Type/Description
  1410.                 ---------       ----------------
  1411.                 hform           HFORM    The form's handle.
  1412.  
  1413.                 ctrl_id         int    The dialog control ID of the button
  1414.                                 or check box control being defined.
  1415.  
  1416.                 pdata           LPINT    Pointer to the integer variable
  1417.                                 that will be automatically initialized or
  1418.                                 updated by the button control.  If NULL is
  1419.                                 given, the button will not manipulate any
  1420.                                 variables and the button's value will have
  1421.                                 to be retrieved manually.
  1422.  
  1423.                 group_id        int    An identifier specifying the group
  1424.                                 the button belongs to.  For example, if
  1425.                                 there was a group box containing 2 radio
  1426.                                 buttons, one for "Male" and the other for
  1427.                                 "Female", you'd define both of their buttons
  1428.                                 with the same pdata and group_id.  If the
  1429.                                 button does not belong to a group, set
  1430.                                 group_id to 0.
  1431.  
  1432.                 on_value        int    The value that will be stored at the
  1433.                                 integer pointed to by pdata if the button is
  1434.                                 checked.
  1435.  
  1436.                 off_value       int    The value that will be stored at the
  1437.                                 integer variable pointed to by pdata if the
  1438.                                 button is not checked.  If the button
  1439.                                 control belongs to a group (group_id is
  1440.                                 nonzero), the value given for off_value is
  1441.                                 ignored.
  1442.  
  1443.                 init_state      int    The initial state of the button
  1444.                                 control.  Can be one of the following
  1445.                                 values:
  1446.  
  1447.                                 Value       Meaning
  1448.                                 -----       -------
  1449.                                 BS_OFF      Button will be initialized off
  1450.                                             (not checked).
  1451.  
  1452.                                 BS_ON       Button will be initialized on
  1453.                                             (checked).
  1454.  
  1455.  
  1456.                                       26   
  1457.  
  1458.                                 BS_GRAYED   Button will be grayed (disabled)
  1459.                                             if it is a 3-state button.
  1460.  
  1461.                                 BS_USEDATA  Button will be initialized to
  1462.                                             the value of the integer pointed
  1463.                                             to by pdata.  If the value is
  1464.                                             equal to the on_value, the
  1465.                                             button will be initialized on.
  1466.                                             Otherwise, the button will be
  1467.                                             initialized off.
  1468.  
  1469.                                 BS_NOTSET   Button's state will not be set.
  1470.  
  1471.                 help_context    DWORD    The help context identifier of the
  1472.                                 Windows Help topic associated with the
  1473.                                 button.  If context-sensitive help is not
  1474.                                 being applied to the button, set
  1475.                                 help_context to 0.  If context-sensitive
  1476.                                 help is being applied to the button, the
  1477.                                 form_set_help function must be called prior
  1478.                                 to the F1 key being pressed.
  1479.  
  1480.     Return Value    The handle of the new button's record or NULL if an
  1481.                     error occurred.  An error can be caused by one of the
  1482.                     following conditions:
  1483.  
  1484.                         Control ID is invalid.
  1485.                         The form_end function has already been called.
  1486.                         Memory allocation error.
  1487.  
  1488.     ________________________________________________________________________
  1489.  
  1490.     button_get_check
  1491.  
  1492.     Syntax      int    button_get_check(hbutton)
  1493.  
  1494.                 Gets the check state of a button.
  1495.  
  1496.                 Parameter       Type/Description
  1497.                 ---------       ----------------
  1498.                 hbutton         HBUTTON    The button's handle.
  1499.  
  1500.     Return Value    BS_OFF if the button is off (not checked), BS_ON if the
  1501.                     button is on (checked), or -1 if an error occurred.
  1502.  
  1503.     ________________________________________________________________________
  1504.  
  1505.     button_get_from_ctrl_id
  1506.  
  1507.     Syntax      HBUTTON    button_get_from_ctrl_id(hform, ctrl_id)
  1508.  
  1509.                 Gets the handle of a button using its dialog control ID as
  1510.  
  1511.  
  1512.                                       27   
  1513.                 input.
  1514.  
  1515.                 Parameter       Type/Description
  1516.                 ---------       ----------------
  1517.                 hform           HFORM    The form's handle.
  1518.  
  1519.                 ctrl_id         int    The dialog control ID of the control
  1520.                                 the button is associated with.
  1521.  
  1522.     Return Value    The handle of the button associated with the input
  1523.                     dialog control ID or NULL if an error occurred.
  1524.  
  1525.     ________________________________________________________________________
  1526.  
  1527.     button_get_from_group
  1528.  
  1529.     Syntax      HBUTTON    button_get_from_group(hform, group_id)
  1530.  
  1531.                 Gets the handle of the checked button in a group of buttons.
  1532.  
  1533.                 Parameter       Type/Description
  1534.                 ---------       ----------------
  1535.                 hform           HFORM    The form's handle.
  1536.  
  1537.                 group_id        int    The group ID of the group of buttons
  1538.                                 to test.
  1539.  
  1540.     Return Value    The handle of the button that is checked or NULL if an
  1541.                     error occurred.
  1542.  
  1543.     ________________________________________________________________________
  1544.  
  1545.     button_get_from_hwnd
  1546.  
  1547.     Syntax      HBUTTON    button_get_from_hwnd(hform, hWnd)
  1548.  
  1549.                 Gets the handle of a button using the window handle of its
  1550.                 control as input.
  1551.  
  1552.                 Parameter       Type/Description
  1553.                 ---------       ----------------
  1554.                 hform           HFORM    The form's handle.
  1555.  
  1556.                 hWnd            HWND    The window handle of the control
  1557.                                 associated with the button.
  1558.  
  1559.     Return Value    The handle of the button associated with the input
  1560.                     window handle or NULL if an error occurred.
  1561.  
  1562.     ________________________________________________________________________
  1563.  
  1564.     button_has_changed
  1565.  
  1566.  
  1567.  
  1568.                                       28   
  1569.     Syntax      int    button_has_changed(hbutton)
  1570.  
  1571.                 Determines whether a button has been changed by the user.
  1572.  
  1573.                 Parameter       Type/Description
  1574.                 ---------       ----------------
  1575.                 hbutton         HBUTTON    The button's handle.
  1576.  
  1577.     Return Value    TRUE if the user has changed the button, FALSE if the
  1578.                     user has not changed the button, or -1 if an error
  1579.                     occurred.
  1580.  
  1581.     ________________________________________________________________________
  1582.  
  1583.     button_lock
  1584.  
  1585.     Syntax      LPBUTTON    button_lock(hbutton)
  1586.  
  1587.                 Locks a button's record in memory so it can be accessed.
  1588.  
  1589.                 Parameter       Type/Description
  1590.                 ---------       ----------------
  1591.                 hbutton         HBUTTON    The button's handle.
  1592.  
  1593.     Return Value    A far pointer to the button's record or NULL if an error
  1594.                     occurred.  See the description for the BUTTON struct for
  1595.                     details.
  1596.  
  1597.     Comments    Once you have obtained a pointer to the button's record, you
  1598.                 are able to read or change any of the record's elements.
  1599.                 However, it is not recommended that you change the values of
  1600.                 any of the elements.
  1601.  
  1602.                 When you are done accessing the button's record, be sure to
  1603.                 call button_unlock.
  1604.  
  1605.                 Calling this function locks the button's record in the
  1606.                 .DLL's local heap.  In addition, the .DLL's entire data
  1607.                 segment is locked in the global heap.  This is required to
  1608.                 ensure the returned far pointer will remain valid until the
  1609.                 call to button_unlock.  For this reason, you should not keep
  1610.                 the button locked any longer than absolutely necessary.
  1611.  
  1612.     ________________________________________________________________________
  1613.  
  1614.     button_set_check
  1615.  
  1616.     Syntax      int    button_set_check(hbutton, state)
  1617.  
  1618.                 Sets the check state of a button.
  1619.  
  1620.                 Parameter       Type/Description
  1621.                 ---------       ----------------
  1622.  
  1623.  
  1624.                                       29   
  1625.                 hbutton         HBUTTON    The button's handle.
  1626.  
  1627.                 state           int    The state to set the button control
  1628.                                 to.  See the description of the
  1629.                                 button_define function for a list of valid
  1630.                                 state values.
  1631.  
  1632.     Return Value    Nonzero if an error occurred.
  1633.  
  1634.     ________________________________________________________________________
  1635.  
  1636.     button_unlock
  1637.  
  1638.     Syntax      void    button_unlock(hbutton)
  1639.  
  1640.                 Unlocks a button's record in memory.
  1641.  
  1642.                 Parameter       Type/Description
  1643.                 ---------       ----------------
  1644.                 hbutton         HBUTTON    The button's handle.
  1645.  
  1646.     Return Value    None.
  1647.  
  1648.     ________________________________________________________________________
  1649.  
  1650.     char_is_printable
  1651.  
  1652.     Syntax      BOOL    char_is_printable(ch)
  1653.  
  1654.                 Determines whether a character is printable.  This
  1655.                 determination is made based upon Windows' current language
  1656.                 driver settings.
  1657.  
  1658.                 Parameter       Type/Description
  1659.                 ---------       ----------------
  1660.                 ch              int    The character to test.
  1661.  
  1662.     Return Value    TRUE if the character is printable; otherwise FALSE.
  1663.  
  1664.     ________________________________________________________________________
  1665.  
  1666.     char_to_lower
  1667.  
  1668.     Syntax      int    char_to_lower(ch)
  1669.  
  1670.                 Converts a character to lowercase.  This conversion is made
  1671.                 based upon Windows' current language driver settings.
  1672.  
  1673.                 Parameter       Type/Description
  1674.                 ---------       ----------------
  1675.                 ch              int    The character to convert.
  1676.  
  1677.     Return Value    The converted character.
  1678.  
  1679.  
  1680.                                       30   
  1681.  
  1682.     ________________________________________________________________________
  1683.  
  1684.     char_to_upper
  1685.  
  1686.     Syntax      int    char_to_upper(ch)
  1687.  
  1688.                 Converts a character to uppercase.  This conversion is made
  1689.                 based upon Windows' current language driver settings.
  1690.  
  1691.                 Parameter       Type/Description
  1692.                 ---------       ----------------
  1693.                 ch              int    The character to convert.
  1694.  
  1695.     Return Value    The converted character.
  1696.  
  1697.     ________________________________________________________________________
  1698.  
  1699.     dproc_enter_error
  1700.  
  1701.     Syntax      int    dproc_enter_error(hform)
  1702.  
  1703.                 This function is part of the dialog procedure's framework.
  1704.                 It must be the first function called in a field's error
  1705.                 handler.
  1706.  
  1707.                 Parameter       Type/Description
  1708.                 ---------       ----------------
  1709.                 hform           HFORM    The form's handle.
  1710.  
  1711.     Return Value    Nonzero if an error occurred.
  1712.  
  1713.     ________________________________________________________________________
  1714.  
  1715.     dproc_enter_idcancel
  1716.  
  1717.     Syntax      int    dproc_enter_idcancel(hform)
  1718.  
  1719.                 This function is part of the dialog procedure's framework.
  1720.                 It must be the first function called in the IDCANCEL
  1721.                 processing of the WM_COMMAND message.
  1722.  
  1723.                 Parameter       Type/Description
  1724.                 ---------       ----------------
  1725.                 hform           HFORM    The form's handle.
  1726.  
  1727.     Return Value    Nonzero if an error occurred.
  1728.  
  1729.     ________________________________________________________________________
  1730.  
  1731.     dproc_enter_idok
  1732.  
  1733.     Syntax      int    dproc_enter_idok(hform)
  1734.  
  1735.  
  1736.                                       31   
  1737.  
  1738.                 This function is part of the dialog procedure's framework.
  1739.                 It must be the first function called in the IDOK processing
  1740.                 of the WM_COMMAND message.
  1741.  
  1742.                 Parameter       Type/Description
  1743.                 ---------       ----------------
  1744.                 hform           HFORM    The form's handle.
  1745.  
  1746.     Return Value    Nonzero if an error occurred.
  1747.  
  1748.     ________________________________________________________________________
  1749.  
  1750.     dproc_enter_wm_command
  1751.  
  1752.     Syntax      int    dproc_enter_wm_command(hform, wParam, lParam)
  1753.  
  1754.                 This function is part of the dialog procedure's framework.
  1755.                 It must be the first function called in the WM_COMMAND
  1756.                 message processing.
  1757.  
  1758.                 Parameter       Type/Description
  1759.                 ---------       ----------------
  1760.                 hform           HFORM    The form's handle.
  1761.  
  1762.                 wParam          unsigned    The wParam parameter passed to
  1763.                                 the dialog procedure by Windows.
  1764.  
  1765.                 lParam          LONG    The lParam parameter passed to the
  1766.                                 dialog procedure by Windows.
  1767.  
  1768.     Return Value    Nonzero if an error occurred.
  1769.  
  1770.     ________________________________________________________________________
  1771.  
  1772.     dproc_exit_error
  1773.  
  1774.     Syntax      int    dproc_exit_error(hform, lParam)
  1775.  
  1776.                 This function is part of the dialog procedure's framework.
  1777.                 It must be the last function called in a field's error
  1778.                 handler.
  1779.  
  1780.                 Parameter       Type/Description
  1781.                 ---------       ----------------
  1782.                 hform           HFORM    The form's handle.
  1783.  
  1784.                 lParam          LONG    The lParam parameter passed to the
  1785.                                 dialog procedure by Windows.
  1786.  
  1787.     Return Value    Nonzero if an error occurred.
  1788.  
  1789.     ________________________________________________________________________
  1790.  
  1791.  
  1792.                                       32   
  1793.  
  1794.     field_data_to_log
  1795.  
  1796.     Syntax      int    field_data_to_log(hfield, pbuf, pdata, data_type)
  1797.  
  1798.                 Converts a value in a specified data type to a character
  1799.                 string in logical field format.
  1800.  
  1801.                 Parameter       Type/Description
  1802.                 ---------       ----------------
  1803.                 hfield          HFIELD    The field's handle.
  1804.  
  1805.                 pbuf            LPSTR    Pointer to the buffer to receive
  1806.                                 the converted value.
  1807.  
  1808.                 pdata           LPVOID    Pointer to the data item to
  1809.                                 containing the data to convert. This
  1810.                                 parameter can point to one of the following
  1811.                                 types:  char (string), int, unsigned, long,
  1812.                                 unsigned long, or double.  The value you
  1813.                                 give for the data_type parameter must
  1814.                                 correspond to the data pointed to by pdata.
  1815.  
  1816.                 data_type       int    Specifies the data type pdata points
  1817.                                 to.  See the description of the field_define
  1818.                                 function for a list of possible values.
  1819.  
  1820.     Return Value    Nonzero if an error occurred.
  1821.  
  1822.     ________________________________________________________________________
  1823.  
  1824.     field_define
  1825.  
  1826.     Syntax      HFIELD    field_define(hform, ctrl_id, pdata, data_type,
  1827.                 picture_string, features, pvalid_func, error_value,
  1828.                 help_context)
  1829.  
  1830.                 Defines a field.  This function is called for each edit
  1831.                 control in your dialog box you want to define.
  1832.  
  1833.                 Parameter       Type/Description
  1834.                 ---------       ----------------
  1835.                 hform           HFORM    The form's handle.
  1836.  
  1837.                 ctrl_id         int    The dialog control ID of the edit
  1838.                                 control you want to define.
  1839.  
  1840.                 pdata           LPVOID    Pointer to the data item you are
  1841.                                 going to initialize or update. This
  1842.                                 parameter can point to one of the following
  1843.                                 types:  char (string), int, unsigned, long,
  1844.                                 unsigned long, or double.  It can also be
  1845.                                 NULL if you do not want any data modified by
  1846.  
  1847.  
  1848.                                       33   
  1849.                                 the field.  The value you give for the
  1850.                                 data_type parameter must correspond to the
  1851.                                 data pointed to by pdata.
  1852.  
  1853.                 data_type       int    Specifies the data type pdata points
  1854.                                 to.  Can be one of the following values:
  1855.  
  1856.                                 Value       Meaning
  1857.                                 -----       -------
  1858.                                 DT_NULL     The pdata parameter is NULL.
  1859.  
  1860.                                 DT_STRING   pdata points to a character
  1861.                                             string.  The string must be
  1862.                                             terminated with a '\0' if you
  1863.                                             are updating existing data.
  1864.  
  1865.                                 DT_INTEGER  pdata points to a signed
  1866.                                             integer.
  1867.  
  1868.                                 DT_UNSIGNED pdata points to an unsigned
  1869.                                             integer.
  1870.  
  1871.                                 DT_LONG     pdata points to a signed long
  1872.                                             integer.
  1873.  
  1874.                                 DT_ULONG    pdata points to an unsigned long
  1875.                                             integer.
  1876.  
  1877.                                 DT_DOUBLE   pdata points to a double-
  1878.                                             precision real number.
  1879.  
  1880.                 picture_string  LPSTR    The field's picture string.  The
  1881.                                 picture string describes the allowable
  1882.                                 characters for each position in the field,
  1883.                                 the size of the field, and the positioning
  1884.                                 of the formatting characters.  See Appendix
  1885.                                 A for a list of characters you can use in
  1886.                                 the picture string.
  1887.  
  1888.                 features        DWORD    One or more features describing how
  1889.                                 the field should behave.  You can combine
  1890.                                 features with the bitwise OR operator. Can
  1891.                                 be one or more of the following values:
  1892.  
  1893.                                 Value           Meaning
  1894.                                 -----           -------
  1895.                                 FDF_NONE        No features defined.
  1896.  
  1897.                                 FDF_COMPLETE    Field must be complete (no
  1898.                                                 blanks allowed unless
  1899.                                                 specified in the picture
  1900.                                                 string).
  1901.  
  1902.  
  1903.  
  1904.                                       34   
  1905.                                 FDF_NOTBLANK    Field cannot be blank.
  1906.  
  1907.                                 FDF_NOTZERO     Field cannot be zero.
  1908.  
  1909.                                 FDF_NOTEDIT     Field cannot be edited.
  1910.                                                 Normally this feature is
  1911.                                                 combined with FDF_UPDATE.
  1912.  
  1913.                                 FDF_MUSTEDIT    Field must be edited.
  1914.  
  1915.                                 FDF_UPDATE      Update existing data.  This
  1916.                                                 initializes the edit control
  1917.                                                 with the data pointed to by
  1918.                                                 pdata.
  1919.  
  1920.                                 FDF_CONDUPD     Conditionally update
  1921.                                                 existing data.  This
  1922.                                                 initializes the edit control
  1923.                                                 with the data pointed to by
  1924.                                                 pdata.  When the user enters
  1925.                                                 the field, the cursor is
  1926.                                                 placed after the last
  1927.                                                 character in the field.  If
  1928.                                                 a character is entered, the
  1929.                                                 field is cleared and the
  1930.                                                 cursor is placed in the
  1931.                                                 first position of the field.
  1932.                                                 If an editing key is
  1933.                                                 pressed, the field is set to
  1934.                                                 update mode.
  1935.  
  1936.                                 FDF_SPCFILL     Space-fill field from the
  1937.                                                 right.  The data_type must
  1938.                                                 be DT_STRING.
  1939.  
  1940.                                 FDF_ZEROFILL    Zero-fill numeric field from
  1941.                                                 the left. FDF_NUMERIC or
  1942.                                                 FDF_CALCNUM must also be
  1943.                                                 specified.
  1944.  
  1945.                                 FDF_BLNKZERO    Blank numeric field if equal
  1946.                                                 to zero. FDF_NUMERIC or
  1947.                                                 FDF_CALCNUM must also be
  1948.                                                 specified.
  1949.  
  1950.                                 FDF_RDPHYS      The DT_STRING variable
  1951.                                                 pointed to by pdata is
  1952.                                                 already in physical field
  1953.                                                 format (has embedded
  1954.                                                 formatting characters).
  1955.  
  1956.                                 FDF_WRPHYS      Merges a DT_STRING field's
  1957.                                                 formatting characters into
  1958.  
  1959.  
  1960.                                       35   
  1961.                                                 its logical contents when
  1962.                                                 storing it.  The destination
  1963.                                                 character buffer will then
  1964.                                                 contain the field's physical
  1965.                                                 contents.
  1966.  
  1967.                                 FDF_UPPER       Characters enters into the
  1968.                                                 field will be converted to
  1969.                                                 uppercase.
  1970.  
  1971.                                 FDF_LOWER       Characters entered into the
  1972.                                                 field will be converted to
  1973.                                                 lowercase.
  1974.  
  1975.                                 FDF_MIXED       Characters entered into the
  1976.                                                 field will be converted to
  1977.                                                 uppercase or lowercase
  1978.                                                 depending upon the previous
  1979.                                                 character.  The Shift keys
  1980.                                                 override the conversion.
  1981.  
  1982.                                 FDF_NUMERIC     Field is a standard numeric
  1983.                                                 field.
  1984.  
  1985.                                 FDF_CALCNUM     Field is a calculator-style
  1986.                                                 numeric field. Digits to the
  1987.                                                 left of the decimal are
  1988.                                                 shifted to the left as
  1989.                                                 digits are entered.
  1990.  
  1991.                                 FDF_VAFFLD      Do not perform validation
  1992.                                                 until the user tries to
  1993.                                                 leave the field.
  1994.  
  1995.                                 FDF_VAFFRM      Do not perform validation
  1996.                                                 until the user selects "OK".
  1997.  
  1998.                                 FDF_COMBO       Field belongs to a combo
  1999.                                                 box. Use caution when
  2000.                                                 defining a combo box field
  2001.                                                 with embedded formatting
  2002.                                                 characters - strings in the
  2003.                                                 combo box's list box must
  2004.                                                 have the same format as the
  2005.                                                 picture string.
  2006.  
  2007.                 pvalid_func     int (FAR PASCAL *) (LPSTR)    The procedure-
  2008.                                 instance address of the field's validation
  2009.                                 function or NULL if there is no validation
  2010.                                 function. This cannot be the address of the
  2011.                                 validation function itself. A procedure-
  2012.                                 instance address must be created using
  2013.                                 MakeProcInstance and this is the value given
  2014.  
  2015.  
  2016.                                       36   
  2017.                                 here.  See the following "Comments" section
  2018.                                 for details.
  2019.  
  2020.                 error_value     int    This is the value that is passed to
  2021.                                 the dialog procedure when the validation
  2022.                                 function returns an error.  The error_value
  2023.                                 is located in the wParam parameter of the
  2024.                                 WM_COMMAND message sent to the dialog
  2025.                                 procedure.  If pvalid_func is NULL, the
  2026.                                 value given for error_value is ignored.
  2027.  
  2028.                 help_context    DWORD    The help context identifier of the
  2029.                                 Windows Help topic associated with the
  2030.                                 field.  If context-sensitive help is not
  2031.                                 being applied to the field, set help_context
  2032.                                 to 0.  If context-sensitive help is being
  2033.                                 applied to the field, the form_set_help
  2034.                                 function must be called prior to the F1 key
  2035.                                 being pressed.
  2036.  
  2037.     Return Value    The handle of the new field's record or NULL if an error
  2038.                     occurred.  An error can be caused by one of the
  2039.                     following conditions:
  2040.  
  2041.                         Picture string is invalid or invalid for the
  2042.                         specified field feature(s).
  2043.                         Control ID is invalid.
  2044.                         The form_end function has already been called.
  2045.                         Memory allocation error.
  2046.  
  2047.     Comments    You must make all calls to this function during your dialog
  2048.                 procedure's WM_INITDIALOG message processing between the
  2049.                 calls to form_begin and form_end.
  2050.  
  2051.                 The validation function must use the Pascal calling
  2052.                 convention and must be declared FAR.  The validation
  2053.                 function must have the following form:
  2054.  
  2055.     Validation  int FAR PASCAL ValidationFunc(LPSTR pbuf)
  2056.     Function
  2057.                 ValidationFunc represents the validation function's name.
  2058.                 The name of the validation function must be listed in an
  2059.                 EXPORTS statement in the program's module definition file.
  2060.                 pbuf represents the validation function's parameter name.
  2061.  
  2062.                 The validation function is used to validate a field.  When
  2063.                 the user tries to leave the field, ValidationFunc is called
  2064.                 and passed a pointer, pbuf, which points to a buffer
  2065.                 containing the current logical contents of the field.  The
  2066.                 ValidationFunc then validates the field's logical contents
  2067.                 and returns zero if no error was found or the logical
  2068.                 position of the error + 1.
  2069.  
  2070.  
  2071.  
  2072.                                       37   
  2073.                 Parameter       Description
  2074.                 ---------       -----------
  2075.                 pbuf            Pointer to the buffer containing the field's
  2076.                                 current logical contents.
  2077.  
  2078.                 Return Value
  2079.  
  2080.                 Zero if the field passed validation, or the logical position
  2081.                 of the error in the field + 1.
  2082.  
  2083.                 Comments
  2084.  
  2085.                 Modifying the data pointed to by pbuf will have no effect on
  2086.                 the contents of the field.
  2087.  
  2088.     ________________________________________________________________________
  2089.  
  2090.     field_disable_feature
  2091.  
  2092.     Syntax      int    field_disable_feature(hfield, feature)
  2093.  
  2094.                 Disables one or more of a field's features.
  2095.  
  2096.                 Parameter       Type/Description
  2097.                 ---------       ----------------
  2098.                 hfield          HFIELD    The field's handle.
  2099.  
  2100.                 feature         DWORD    The feature to disable.  To disable
  2101.                                 multiple features, combine them with the
  2102.                                 bitwise OR operator.  See the description of
  2103.                                 the field_define function for a list of
  2104.                                 features that can be specified.
  2105.  
  2106.     Return Value    Nonzero if an error occurred.
  2107.  
  2108.     ________________________________________________________________________
  2109.  
  2110.     field_enable_feature
  2111.  
  2112.     Syntax      int    field_enable_feature(hfield, feature)
  2113.  
  2114.                 Enables one or more of a field's features.
  2115.  
  2116.                 Parameter       Type/Description
  2117.                 ---------       ----------------
  2118.                 hfield          HFIELD    The field's handle.
  2119.  
  2120.                 feature         DWORD    The feature to enable.  To enable
  2121.                                 multiple features, combine them with the
  2122.                                 bitwise OR operator.  See the description of
  2123.                                 the field_define function for a list of
  2124.                                 features that can be specified.
  2125.  
  2126.  
  2127.  
  2128.                                       38   
  2129.     Return Value    Nonzero if an error occurred.
  2130.  
  2131.     ________________________________________________________________________
  2132.  
  2133.     field_get_character
  2134.  
  2135.     Syntax      int    field_get_character(hfield, position, physical)
  2136.  
  2137.                 Gets a character from the contents of a field.
  2138.  
  2139.                 Parameter       Type/Description
  2140.                 ---------       ----------------
  2141.                 hfield          HFIELD    The field's handle.
  2142.  
  2143.                 position        int    The logical or physical position from
  2144.                                 which the character will be retrieved.
  2145.  
  2146.                 physical        BOOL    TRUE if position is a physical
  2147.                                 position.  FALSE if position is a logical
  2148.                                 position.
  2149.  
  2150.     Return Value    The specified character or -1 if an error occurred.
  2151.  
  2152.     ________________________________________________________________________
  2153.  
  2154.     field_get_decimal_pos
  2155.  
  2156.     Syntax      int    field_get_decimal_pos(hfield)
  2157.  
  2158.                 Gets the virtual logical position of the decimal point in a
  2159.                 field.  For example if a field had a picture string of
  2160.                 "####.##", the virtual logical position of the decimal point
  2161.                 would be 4. For "###", it would be 3.
  2162.  
  2163.                 Parameter       Type/Description
  2164.                 ---------       ----------------
  2165.                 hfield          HFIELD    The field's handle.
  2166.  
  2167.     Return Value    The virtual logical position of the decimal point or -1
  2168.                     if an error occurred.
  2169.  
  2170.     ________________________________________________________________________
  2171.  
  2172.     field_get_from_ctrl_id
  2173.  
  2174.     Syntax      HFIELD    field_get_from_ctrl_id(hform, ctrl_id)
  2175.  
  2176.                 Gets the handle for a field associated with a given dialog
  2177.                 control ID.
  2178.  
  2179.                 Parameter       Type/Description
  2180.                 ---------       ----------------
  2181.                 hform           HFORM    The form's handle.
  2182.  
  2183.  
  2184.                                       39   
  2185.  
  2186.                 ctrl_id         int    The dialog control ID of the field's
  2187.                                 edit control.
  2188.  
  2189.     Return Value    The handle of the field associated with the input dialog
  2190.                     control ID or NULL if an error occurred.
  2191.  
  2192.     ________________________________________________________________________
  2193.  
  2194.     field_get_from_hwnd
  2195.  
  2196.     Syntax      HFIELD    field_get_from_hwnd(hform, hWnd)
  2197.  
  2198.                 Gets the handle for a field associated with a given edit
  2199.                 control's window handle.
  2200.  
  2201.                 Parameter       Type/Description
  2202.                 ---------       ----------------
  2203.                 hform           HFORM    The form's handle.
  2204.  
  2205.                 hWnd            HWND    The window handle of the field's
  2206.                                 edit control.
  2207.  
  2208.     Return Value    The handle of the field associated with the input window
  2209.                     handle or NULL if an error occurred.
  2210.  
  2211.     ________________________________________________________________________
  2212.  
  2213.     field_get_pos_info
  2214.  
  2215.     Syntax      int    field_get_pos_info(hfield, logical_position, pfpos)
  2216.  
  2217.                 Gets information related to a field's logical position.
  2218.                 This information includes the physical position, selection,
  2219.                 picture string position, validation character, validation
  2220.                 character occurrence, and which side of the decimal point
  2221.                 the position lies.
  2222.  
  2223.                 Parameter           Type/Description
  2224.                 ---------           ----------------
  2225.                 hfield              HFIELD    The field's handle.
  2226.  
  2227.                 logical_position    int    The logical position to get
  2228.                                     information for.
  2229.  
  2230.                 pfpos               LPFIELD_POS    A pointer to the
  2231.                                     FIELD_POS struct which will receive the
  2232.                                     information.  See the description of the
  2233.                                     FIELD_POS structure for details.
  2234.  
  2235.     Return Value    Nonzero if an error occurred.
  2236.  
  2237.     ________________________________________________________________________
  2238.  
  2239.  
  2240.                                       40   
  2241.  
  2242.     field_get_position
  2243.  
  2244.     Syntax      int    field_get_position(hfield, pfpos)
  2245.  
  2246.                 Gets information related to the current position in a field.
  2247.                 This information includes the logical position, physical
  2248.                 position, selection, picture string position, validation
  2249.                 character, validation character occurrence, and which side
  2250.                 of the decimal point the position lies.
  2251.  
  2252.                 Parameter       Type/Description
  2253.                 ---------       ----------------
  2254.                 hfield          HFIELD    The field's handle.
  2255.  
  2256.                 pfpos           LPFIELD_POS    A pointer to the FIELD_POS
  2257.                                 struct which will receive the information.
  2258.                                 See the description of the FIELD_POS
  2259.                                 structure for details.
  2260.  
  2261.     Return Value    Nonzero if an error occurred.
  2262.  
  2263.     Comments    The field identified by hfield must have the focus when
  2264.                 calling this function.
  2265.  
  2266.     ________________________________________________________________________
  2267.  
  2268.     field_get_text
  2269.  
  2270.     Syntax      int    field_get_text(hfield, pbuf, physical)
  2271.  
  2272.                 Gets the contents of a field.
  2273.  
  2274.                 Parameter       Type/Description
  2275.                 ---------       ----------------
  2276.                 hfield          HFIELD    The field's handle.
  2277.  
  2278.                 pbuf            LPSTR    Pointer to the buffer to receives
  2279.                                 the field's contents.
  2280.  
  2281.                 physical        BOOL    TRUE specifies physical contents are
  2282.                                 to be copied to pbuf. FALSE specifies
  2283.                                 logical contents are to be copied.
  2284.  
  2285.     Return Value    Nonzero if an error occurred.
  2286.  
  2287.     ________________________________________________________________________
  2288.  
  2289.     field_has_changed
  2290.  
  2291.     Syntax      int    field_has_changed(hfield)
  2292.  
  2293.                 Determines whether a field has been edited by the user.
  2294.  
  2295.  
  2296.                                       41   
  2297.  
  2298.                 Parameter       Type/Description
  2299.                 ---------       ----------------
  2300.                 hfield          HFIELD    The field's handle.
  2301.  
  2302.     Return Value    TRUE if the user has edited the field, FALSE if the user
  2303.                     has not edited the field, or -1 if an error occurred.
  2304.  
  2305.     ________________________________________________________________________
  2306.  
  2307.     field_insert_decimal
  2308.  
  2309.     Syntax      int    field_insert_decimal(hfield, pbuf)
  2310.  
  2311.                 Inserts a decimal point into a buffer containing a numeric
  2312.                 field's logical contents.
  2313.  
  2314.                 Parameter       Type/Description
  2315.                 ---------       ----------------
  2316.                 hfield          HFIELD    The field's handle.
  2317.  
  2318.                 pbuf            LPSTR    Pointer to the buffer containing
  2319.                                 the field's logical contents.
  2320.  
  2321.     Return Value    Nonzero if an error occurred.
  2322.  
  2323.     Comments    The resulting value in the buffer can be converted to a
  2324.                 double by calling the atof function.  This is useful in
  2325.                 validation functions.
  2326.  
  2327.     ________________________________________________________________________
  2328.  
  2329.     field_lock
  2330.  
  2331.     Syntax      LPFIELD    field_lock(hfield)
  2332.  
  2333.                 Locks a field's record in memory so it can be accessed.
  2334.  
  2335.                 Parameter       Type/Description
  2336.                 ---------       ----------------
  2337.                 hfield          HFIELD    The field's handle.
  2338.  
  2339.     Return Value    A far pointer to the field's record or NULL if an error
  2340.                     occurred.  See the description for the FIELD struct for
  2341.                     details.
  2342.  
  2343.     Comments    Once you have obtained a pointer to the field's record, you
  2344.                 are able to read or change any of the record's elements.
  2345.                 However, it is not recommended that you change the values of
  2346.                 any of the elements.
  2347.  
  2348.                 When you are done accessing the field's record, be sure to
  2349.                 call field_unlock.
  2350.  
  2351.  
  2352.                                       42   
  2353.  
  2354.                 Calling this function locks the field's record in the .DLL's
  2355.                 local heap.  In addition, the .DLL's entire data segment is
  2356.                 locked in the global heap.  This is required to ensure the
  2357.                 returned far pointer will remain valid until the call to
  2358.                 field_unlock.  For this reason, you should not keep the
  2359.                 field locked any longer than absolutely necessary.
  2360.  
  2361.     ________________________________________________________________________
  2362.  
  2363.     field_log_to_data
  2364.  
  2365.     Syntax      int    field_log_to_data(hfield, pbuf, pdata, data_type)
  2366.  
  2367.                 Converts a character string in logical field format to a
  2368.                 value in a specified data type.
  2369.  
  2370.                 Parameter       Type/Description
  2371.                 ---------       ----------------
  2372.                 hfield          HFIELD    The field's handle.
  2373.  
  2374.                 pbuf            LPSTR    Pointer to the buffer containing
  2375.                                 the string to convert.
  2376.  
  2377.                 pdata           LPVOID    Pointer to the data item to
  2378.                                 receive the converted value. This parameter
  2379.                                 can point to one of the following types:
  2380.                                 char (string), int, unsigned, long, unsigned
  2381.                                 long, or double.  The value you give for the
  2382.                                 data_type parameter must correspond to the
  2383.                                 data pointed to by pdata.
  2384.  
  2385.                 data_type       int    Specifies the data type pdata points
  2386.                                 to.  See the description of the field_define
  2387.                                 function for a list of possible values.
  2388.  
  2389.     Return Value    Nonzero if an error occurred.
  2390.  
  2391.     ________________________________________________________________________
  2392.  
  2393.     field_log_to_phys
  2394.  
  2395.     Syntax      int    field_log_to_phys(hfield, pbuf)
  2396.  
  2397.                 Converts a character string in logical field format to
  2398.                 physical field format.
  2399.  
  2400.                 Parameter       Type/Description
  2401.                 ---------       ----------------
  2402.                 hfield          HFIELD    The field's handle.
  2403.  
  2404.                 pbuf            LPSTR    Pointer to the buffer containing
  2405.                                 the string to convert.
  2406.  
  2407.  
  2408.                                       43   
  2409.  
  2410.     Return Value    Nonzero if an error occurred.
  2411.  
  2412.     ________________________________________________________________________
  2413.  
  2414.     field_phys_to_log
  2415.  
  2416.     Syntax      int    field_phys_to_log(hfield, pbuf)
  2417.  
  2418.                 Converts a character string in physical field format to
  2419.                 logical field format.
  2420.  
  2421.                 Parameter       Type/Description
  2422.                 ---------       ----------------
  2423.                 hfield          HFIELD    The field's handle.
  2424.  
  2425.                 pbuf            LPSTR    Pointer to the buffer containing
  2426.                                 the string to convert.
  2427.  
  2428.     Return Value    Nonzero if an error occurred.
  2429.  
  2430.     ________________________________________________________________________
  2431.  
  2432.     field_set_text
  2433.  
  2434.     Syntax      int    field_set_text(hfield, pbuf, physical)
  2435.  
  2436.                 Sets the contents of a field.
  2437.  
  2438.                 Parameter       Type/Description
  2439.                 ---------       ----------------
  2440.                 hfield          HFIELD    The field's handle.
  2441.  
  2442.                 pbuf            LPSTR    Pointer to the buffer containing
  2443.                                 the string to be used for the field's
  2444.                                 contents.
  2445.  
  2446.                 physical        BOOL    TRUE if the string pointed to by
  2447.                                 pbuf is in physical field format. FALSE if
  2448.                                 the string is in logical field format.
  2449.  
  2450.     Return Value    Nonzero if an error occurred.
  2451.  
  2452.     ________________________________________________________________________
  2453.  
  2454.     field_unlock
  2455.  
  2456.     Syntax      void    field_unlock(hfield)
  2457.  
  2458.                 Unlocks a field's record in memory.
  2459.  
  2460.                 Parameter       Type/Description
  2461.                 ---------       ----------------
  2462.  
  2463.  
  2464.                                       44   
  2465.                 hfield          HFIELD    The field's handle.
  2466.  
  2467.     Return Value    None.
  2468.  
  2469.     ________________________________________________________________________
  2470.  
  2471.     form_begin
  2472.  
  2473.     Syntax      HFORM  form_begin(hDlg)
  2474.  
  2475.                 Begins a form definition.
  2476.  
  2477.                 Parameter       Type/Description
  2478.                 ---------       ----------------
  2479.                 hDlg            HWND    The window handle of the dialog box.
  2480.  
  2481.     Return Value    The new form's handle or NULL if an error occurred. This
  2482.                     handle should be assigned to a static or global variable
  2483.                     for use in future function calls.
  2484.  
  2485.     Comments    This function must be called during the WM_INITDIALOG
  2486.                 message processing in the dialog procedure.  You should not
  2487.                 call any Windows functions which generate WM_COMMAND
  2488.                 messages before calling form_begin.  Be sure to call
  2489.                 form_end after all controls have been defined.
  2490.  
  2491.     ________________________________________________________________________
  2492.  
  2493.     form_end
  2494.  
  2495.     Syntax      int    form_end(hform)
  2496.  
  2497.                 Ends a form definition.
  2498.  
  2499.                 Parameter       Type/Description
  2500.                 ---------       ----------------
  2501.                 hform           HFORM    The form's handle.
  2502.  
  2503.     Return Value    Nonzero if an error occurred.
  2504.  
  2505.     Comments    This function must be called during the WM_INITDIALOG
  2506.                 message processing in the dialog procedure.  After calling
  2507.                 this function, no more controls can be defined.
  2508.  
  2509.     ________________________________________________________________________
  2510.  
  2511.     form_get_active
  2512.  
  2513.     Syntax      HFORM    form_get_active()
  2514.  
  2515.                 Gets the handle of the active form.
  2516.  
  2517.     Return Value    The handle of the active form or NULL if an error
  2518.  
  2519.  
  2520.                                       45   
  2521.                     occurred.
  2522.  
  2523.     ________________________________________________________________________
  2524.  
  2525.     form_get_from_hdlg
  2526.  
  2527.     Syntax      HFORM    form_get_from_hdlg(hDlg)
  2528.  
  2529.                 Gets the handle of a form associated with a given dialog box
  2530.                 window handle.
  2531.  
  2532.                 Parameter       Type/Description
  2533.                 ---------       ----------------
  2534.                 hDlg            HWND    The window handle of the dialog box.
  2535.  
  2536.     Return Value    The handle of the form associated with the input dialog
  2537.                     box window handle or NULL if an error occurred.
  2538.  
  2539.     ________________________________________________________________________
  2540.  
  2541.     form_has_changed
  2542.  
  2543.     Syntax      int    form_has_changed(hform)
  2544.  
  2545.                 Determines whether any of the defined fields or buttons of a
  2546.                 form have been changed by the user.
  2547.  
  2548.                 Parameter       Type/Description
  2549.                 ---------       ----------------
  2550.                 hform           HFORM    The form's handle.
  2551.  
  2552.     Return Value    TRUE if one or more defined fields or buttons have been
  2553.                     changed by the user, FALSE if no defined fields or
  2554.                     buttons have been changed, or -1 if an error occurred.
  2555.  
  2556.     ________________________________________________________________________
  2557.  
  2558.     form_in_error_cond
  2559.  
  2560.     Syntax      int    form_in_error_cond(hform)
  2561.  
  2562.                 Determines whether a form is in an error condition.
  2563.  
  2564.                 Parameter       Type/Description
  2565.                 ---------       ----------------
  2566.                 hform           HFORM    The form's handle.
  2567.  
  2568.     Return Value    TRUE if the form is in an error condition, FALSE if the
  2569.                     form is not in an error condition, or -1 if an error
  2570.                     occurred.
  2571.  
  2572.     Comments    When a validation error has occurred, the form is in an
  2573.                 error condition.  Even if a field's error handler is active,
  2574.  
  2575.  
  2576.                                       46   
  2577.                 messages are still sent to the dialog procedure.  It is
  2578.                 often desirable to check to see if the form is in an error
  2579.                 condition before processing these messages.  For example, if
  2580.                 the form is in an error condition, you would not want to any
  2581.                 IDOK processing to occur.  Calling this function first can
  2582.                 prevent this from happening.
  2583.  
  2584.     ________________________________________________________________________
  2585.  
  2586.     form_is_cancelled
  2587.  
  2588.     Syntax      int    form_is_cancelled(hform)
  2589.  
  2590.                 Determines whether a form has been cancelled.
  2591.  
  2592.                 Parameter       Type/Description
  2593.                 ---------       ----------------
  2594.                 hform           HFORM    The form's handle.
  2595.  
  2596.     Return Value    TRUE if the form has been cancelled, FALSE if the form
  2597.                     has not been cancelled, or -1 if an error occurred.
  2598.  
  2599.     Comments    The form is cancelled when the user presses the Escape key
  2600.                 or clicks on the "Cancel" button.  Even if the form has been
  2601.                 cancelled, messages are still sent to the dialog procedure.
  2602.                 It is often desirable to check to see if the form has been
  2603.                 cancelled before processing these messages.
  2604.  
  2605.     ________________________________________________________________________
  2606.  
  2607.     form_lock
  2608.  
  2609.     Syntax      LPFORM    form_lock(hform)
  2610.  
  2611.             Locks a form's record in memory so it can be accessed.
  2612.  
  2613.                 Parameter       Type/Description
  2614.                 ---------       ----------------
  2615.                 hform           HFORM    The form's handle.
  2616.  
  2617.     Return Value    A far pointer to the form's record or NULL if an error
  2618.                     occurred.  See the description for the FORM struct for
  2619.                     details.
  2620.  
  2621.     Comments    Once you have obtained a pointer to the form's record, you
  2622.                 are able to read or change any of the record's elements.
  2623.                 However, it is not recommended that you change the values of
  2624.                 any of the elements.
  2625.  
  2626.                 When you are done accessing the form's record, be sure to
  2627.                 call form_unlock.
  2628.  
  2629.                 Calling this function locks the form's record in the .DLL's
  2630.  
  2631.  
  2632.                                       47   
  2633.                 local heap.  In addition, the .DLL's entire data segment is
  2634.                 locked in the global heap.  This is required to ensure the
  2635.                 returned far pointer will remain valid until the call to
  2636.                 form_unlock.  For this reason, you should not keep the form
  2637.                 locked any longer than absolutely necessary.
  2638.  
  2639.     ________________________________________________________________________
  2640.  
  2641.     form_process
  2642.  
  2643.     Syntax      int    form_process(hform)
  2644.  
  2645.                 Processes all defined controls in a form.  Calling this
  2646.                 function copies the values contained in the defined fields
  2647.                 and buttons to the data items specified in the calls to
  2648.                 field_define and button_define.
  2649.  
  2650.                 Parameter       Type/Description
  2651.                 ---------       ----------------
  2652.                 hform           HFORM    The form's handle.
  2653.  
  2654.     Return Value    Nonzero if an error occurred.
  2655.  
  2656.     Comments    This function is normally called during IDOK processing of
  2657.                 the WM_COMMAND message in the dialog procedure.  The
  2658.                 dproc_enter_idok, form_in_error_cond, and form_validate
  2659.                 functions must be called first to ensure none of the fields'
  2660.                 values have been invalidated.  EndDialog cannot be called
  2661.                 until after calling this function.
  2662.  
  2663.     ________________________________________________________________________
  2664.  
  2665.     form_set_help
  2666.  
  2667.     Syntax      int    form_set_help(hform, help_file_name)
  2668.  
  2669.                 Sets the file name of the Windows Help file to be used for
  2670.                 context-sensitive help for individual controls in the dialog
  2671.                 box.
  2672.  
  2673.                 Parameter       Type/Description
  2674.                 ---------       ----------------
  2675.                 hform           HFORM    The form's handle.
  2676.  
  2677.                 help_file_name  LPSTR    Pointer to the character string
  2678.                                 containing the Windows Help file name.  The
  2679.                                 full drive:path specification can be
  2680.                                 included.
  2681.  
  2682.     Return Value    Nonzero if an error occurred.
  2683.  
  2684.     Comments    This function must be called if context-sensitive help is to
  2685.                 be applied to individual controls.
  2686.  
  2687.  
  2688.                                       48   
  2689.  
  2690.     ________________________________________________________________________
  2691.  
  2692.     form_terminate
  2693.  
  2694.     Syntax      int    form_terminate(hform)
  2695.  
  2696.                 Terminates the form.  All memory allocated by the form and
  2697.                 the defined controls within it will be freed.
  2698.  
  2699.                 Parameter       Type/Description
  2700.                 ---------       ----------------
  2701.                 hform           HFORM    The form's handle.
  2702.  
  2703.     Return Value    Nonzero if an error occurred.
  2704.  
  2705.     Comments    This function is normally called during IDOK and IDCANCEL
  2706.                 processing of the WM_COMMAND message in the dialog
  2707.                 procedure.  The call to EndDialog must be made before
  2708.                 calling this function.
  2709.  
  2710.                 All handles and pointers to the form and its defined
  2711.                 cotnrols will no longer be valid after calling this
  2712.                 function.
  2713.  
  2714.     ________________________________________________________________________
  2715.  
  2716.     form_unlock
  2717.  
  2718.     Syntax      void    form_unlock(hform)
  2719.  
  2720.                 Unlocks a form's record in memory.
  2721.  
  2722.                 Parameter       Type/Description
  2723.                 ---------       ----------------
  2724.                 hform           HFORM    The form's handle.
  2725.  
  2726.     Return Value    None.
  2727.  
  2728.     ________________________________________________________________________
  2729.  
  2730.     form_validate
  2731.  
  2732.     Syntax      HFIELD    form_validate(hform)
  2733.  
  2734.                 Validates all fields in a form.  If a field fails
  2735.                 validation, input focus will be set to the field in error.
  2736.  
  2737.                 Parameter       Type/Description
  2738.                 ---------       ----------------
  2739.                 hform           HFORM    The form's handle.
  2740.  
  2741.     Return Value    The handle of the field that failed validation or NULL
  2742.  
  2743.  
  2744.                                       49   
  2745.                     if all fields passed validation.  A value of -1 will be
  2746.                     returned in the event of an error.
  2747.  
  2748.     Comments    This function is normally called during IDOK processing of
  2749.                 the WM_COMMAND message in the dialog procedure.  The
  2750.                 dproc_enter_idok and form_in_error_cond functions must be
  2751.                 called before calling this function.
  2752.  
  2753.                 If a field fails validation, IDOK processing should be
  2754.                 discontinued.
  2755.  
  2756.     ________________________________________________________________________
  2757.  
  2758.     genctrl_define
  2759.  
  2760.     Syntax      HGENCTRL    genctrl_define(hform, ctrl_id, help_context)
  2761.  
  2762.                 Defines a generic control.
  2763.  
  2764.                 Parameter       Type/Description
  2765.                 ---------       ----------------
  2766.                 hform           HFORM    The form's handle.
  2767.  
  2768.                 ctrl_id         int    The dialog control ID of the control
  2769.                                 to define.
  2770.  
  2771.                 help_context    DWORD    The help context identifier of the
  2772.                                 Windows Help topic associated with the
  2773.                                 control.  If context-sensitive help is not
  2774.                                 being applied to the control, set
  2775.                                 help_context to 0.  If context-sensitive
  2776.                                 help is being applied to the control, the
  2777.                                 form_set_help function must be called prior
  2778.                                 to the F1 key being pressed.
  2779.  
  2780.     Return Value    The handle of the new generic control's record or NULL
  2781.                     if an error occurred.  An error can be caused by one of
  2782.                     the following conditions:
  2783.  
  2784.                         Control ID is invalid.
  2785.                         The form_end function has already been called.
  2786.                         Memory allocation error.
  2787.  
  2788.     ________________________________________________________________________
  2789.  
  2790.     statmsg_define
  2791.  
  2792.     Syntax      int    statmsg_define(hform, ctrl_id, which, onmsg, offmsg)
  2793.  
  2794.                 Defines a static text control to be used as a status message
  2795.                 for the Insert, CapsLock, or NumLock key.
  2796.  
  2797.                 Parameter       Type/Description
  2798.  
  2799.  
  2800.                                       50   
  2801.                 ---------       ----------------
  2802.                 hform           HFORM    The form's handle.
  2803.  
  2804.                 ctrl_id         int    The dialog control ID of the static
  2805.                                 text control to be used for the status
  2806.                                 message.
  2807.  
  2808.                 which           int    Identifier that specifies which
  2809.                                 status message is to be assigned to the
  2810.                                 control.  Can be one of the following
  2811.                                 values:
  2812.  
  2813.                                 Value           Meaning
  2814.                                 -----           -------
  2815.                                 SM_INSERT       Insert key status message.
  2816.  
  2817.                                 SM_CAPSLOCK     CapsLock key status message.
  2818.  
  2819.                                 SM_NUMLOCK      NumLock key status message.
  2820.  
  2821.                 onmsg           LPSTR    The message to set the static text
  2822.                                 control to when the key identified by which
  2823.                                 is toggled on.
  2824.  
  2825.                 offmsg          LPSTR    The message to set the static text
  2826.                                 control to when the key identified by which
  2827.                                 is toggled off.
  2828.  
  2829.     Return Value    Nonzero if an error occurred.
  2830.  
  2831.     Comments    The static text control used for the key status message will
  2832.                 be updated automatically when the user toggles the key.
  2833.                 However, if the key is toggled while the user is in a
  2834.                 control that has not been defined, the message will not be
  2835.                 updated until the user moves to a control that has been
  2836.                 defined.
  2837.  
  2838.     ________________________________________________________________________
  2839.  
  2840.     str_delete_char
  2841.  
  2842.     Syntax      int    str_delete_char(pstr, ch)
  2843.  
  2844.                 Deletes the first occurrence of a character from a string.
  2845.  
  2846.                 Parameter       Type/Description
  2847.                 ---------       ----------------
  2848.                 pstr            LPSTR    Pointer to the string to operate
  2849.                                 on.
  2850.  
  2851.                 ch              int    The character to delete.
  2852.  
  2853.     Return Value    Nonzero if the character was not found.
  2854.  
  2855.  
  2856.                                       51   
  2857.  
  2858.     ________________________________________________________________________
  2859.  
  2860.     str_insert_char
  2861.  
  2862.     Syntax      void    str_insert_char(pstr, ch, offs)
  2863.  
  2864.                 Inserts a character into a string.
  2865.  
  2866.                 Parameter       Type/Description
  2867.                 ---------       ----------------
  2868.                 pstr            LPSTR    Pointer to the string to operate
  2869.                                 on.
  2870.  
  2871.                 ch              int    The character to insert.
  2872.  
  2873.                 offs            int    The offset into the string where the
  2874.                                 character is to be inserted.
  2875.  
  2876.     Return Value    None.
  2877.  
  2878.     ________________________________________________________________________
  2879.  
  2880.     str_is_blank
  2881.  
  2882.     Syntax      BOOL    str_is_blank(pstr)
  2883.  
  2884.                 Determines whether a string is blank.
  2885.  
  2886.                 Parameter       Type/Description
  2887.                 ---------       ----------------
  2888.                 pstr            LPSTR    Pointer to the string to test.
  2889.  
  2890.     Return Value    TRUE if the string is blank; otherwise FALSE.
  2891.  
  2892.     ________________________________________________________________________
  2893.  
  2894.     str_is_value_zero
  2895.  
  2896.     Syntax      BOOL    str_is_value_zero(pstr)
  2897.  
  2898.                 Determines whether a string contains a numeric value of
  2899.                 zero.
  2900.  
  2901.                 Parameter       Type/Description
  2902.                 ---------       ----------------
  2903.                 pstr            LPSTR    Pointer to the string to test.
  2904.  
  2905.     Return Value    TRUE if the string contains a numeric value of zero;
  2906.                     otherwise FALSE.
  2907.  
  2908.     ________________________________________________________________________
  2909.  
  2910.  
  2911.  
  2912.                                       52   
  2913.     str_trim_spaces
  2914.  
  2915.     Syntax      void    str_trim_spaces(pstr)
  2916.  
  2917.                 Trims trailing spaces from a string.
  2918.  
  2919.                 Parameter       Type/Description
  2920.                 ---------       ----------------
  2921.                 pstr            LPSTR    Pointer to the string to operate
  2922.                                 on.
  2923.  
  2924.     Return Value    None.
  2925.  
  2926.  
  2927.  
  2928.  
  2929.  
  2930.  
  2931.  
  2932.  
  2933.  
  2934.  
  2935.  
  2936.  
  2937.  
  2938.  
  2939.  
  2940.  
  2941.  
  2942.  
  2943.  
  2944.  
  2945.  
  2946.  
  2947.  
  2948.  
  2949.  
  2950.  
  2951.  
  2952.  
  2953.  
  2954.  
  2955.  
  2956.  
  2957.  
  2958.  
  2959.  
  2960.  
  2961.  
  2962.  
  2963.  
  2964.  
  2965.  
  2966.  
  2967.  
  2968.                                       53   
  2969.  
  2970.  
  2971.  
  2972.  
  2973.  
  2974.  
  2975.  
  2976.  
  2977.  
  2978.  
  2979.  
  2980.  
  2981.  
  2982.  
  2983.  
  2984.  
  2985.  
  2986.  
  2987.  
  2988.  
  2989.  
  2990.  
  2991.  
  2992.  
  2993.  
  2994.  
  2995.                               Data Type Reference
  2996.  
  2997.  
  2998.  
  2999.  
  3000.  
  3001.  
  3002.  
  3003.  
  3004.  
  3005.  
  3006.  
  3007.  
  3008.  
  3009.  
  3010.  
  3011.  
  3012.  
  3013.  
  3014.  
  3015.  
  3016.  
  3017.  
  3018.  
  3019.  
  3020.  
  3021.  
  3022.  
  3023.  
  3024.                                       54   
  3025.  
  3026.     BUTTON
  3027.  
  3028.     Button Record
  3029.  
  3030.             The BUTTON structure contains information about a defined
  3031.             button.
  3032.  
  3033.             typedef struct {
  3034.                 HWND hWnd;
  3035.                 HBUTTON hbutton;
  3036.                 HBUTTON hnext_button;
  3037.                 int ctrl_id;
  3038.                 LPINT pdata;
  3039.                 int group_id;
  3040.                 int on_value;
  3041.                 int off_value;
  3042.                 DWORD help_context;
  3043.                 BOOL has_changed;
  3044.             } BUTTON;
  3045.  
  3046.             The BUTTON structure contains the following elements:
  3047.  
  3048.             Element         Description
  3049.             -------         -----------
  3050.             hWnd            Window handle of the button control.
  3051.  
  3052.             hbutton         Handle of the BUTTON data structure.
  3053.                             (Self-reference)
  3054.  
  3055.             hnext_button    Handle of the next BUTTON data structure in the
  3056.                             linked list of buttons.
  3057.  
  3058.             ctrl_id         Dialog control ID of the button control
  3059.                             associated with the button.
  3060.  
  3061.             pdata           Pointer to the integer variable being updated or
  3062.                             initialized by the button.
  3063.  
  3064.             group_id        Group ID of the button.  Other buttons with the
  3065.                             same group ID belong to the same group as this
  3066.                             button.
  3067.  
  3068.             on_value        The value that will be stored at the integer
  3069.                             variable pointed to by pdata if the button is
  3070.                             checked.
  3071.  
  3072.             off_value       The value that will be stored at the integer
  3073.                             variable pointed to by pdata if the button is
  3074.                             not checked.
  3075.  
  3076.             help_context    The help context identifier of the Windows Help
  3077.                             topic associated with the button. has_changed
  3078.  
  3079.  
  3080.                                       55   
  3081.                             Flag indicating whether the button has been
  3082.                             changed by the user.
  3083.  
  3084.     Comments    The values of these elements should not be directly changed.
  3085.  
  3086.     ________________________________________________________________________
  3087.  
  3088.     FIELD
  3089.  
  3090.     Field Record
  3091.  
  3092.             The FIELD structure contains information about a defined field.
  3093.  
  3094.             typedef struct {
  3095.                 HWND hwnd;
  3096.                 HWND hcombo;
  3097.                 HFIELD hfield;
  3098.                 HFIELD hnext_field;
  3099.                 int ctrl_id;
  3100.                 LPVOID pdata;
  3101.                 int data_type;
  3102.                 LPSTR picture_string;
  3103.                 DWORD features;
  3104.                 int (FAR PASCAL *pvalid_func) (LPSTR);
  3105.                 int error_value;
  3106.                 DWORD help_context;
  3107.                 BOOL has_changed;
  3108.                 int logical_size;
  3109.                 int physical_size;
  3110.                 int decimal_position;
  3111.             } FIELD;
  3112.  
  3113.             The FIELD structure contains the following elements:
  3114.  
  3115.             Element         Description
  3116.             -------         -----------
  3117.             hwnd            Window handle of the field's edit control.
  3118.  
  3119.             hcombo          Window handle of the combo box a field belongs
  3120.                             to.
  3121.  
  3122.             hfield          Handle of the FIELD data structure.
  3123.                             (Self-reference)
  3124.  
  3125.             hnext_field     Handle of the next FIELD data structure in the
  3126.                             linked list of fields.
  3127.  
  3128.             ctrl_id         Dialog control ID of the edit control associated
  3129.                             with the field.
  3130.  
  3131.             pdata           Pointer to the data item being updated or
  3132.                             initialized by the field.  This can point to a
  3133.                             character string, integer, unsigned integer,
  3134.  
  3135.  
  3136.                                       56   
  3137.                             long integer, unsigned long integer, or double
  3138.                             precision floating point data type.
  3139.  
  3140.             data_type       Specifies what pdata points to.  See the
  3141.                             description of the field_define function for a
  3142.                             list of possible values.
  3143.  
  3144.             picture_string  Pointer to the picture string associated with
  3145.                             the field.
  3146.  
  3147.             features        Contains one or more field features combined
  3148.                             with the bitwise OR operator.  See the
  3149.                             description of the field_define function for a
  3150.                             list of possible values.
  3151.  
  3152.             pvalid_func     Procedure-instance address of the field's
  3153.                             validation function.
  3154.  
  3155.             error_value     Value that gets passed to the dialog procedure
  3156.                             (in the wParam parameter of the WM_COMMAND
  3157.                             message) when the validation function returns an
  3158.                             error.
  3159.  
  3160.             help_context    The help context identifier of the Windows Help
  3161.                             topic associated with the field.
  3162.  
  3163.             has_changed     Flag indicating whether the field has been
  3164.                             edited by the user.
  3165.  
  3166.             logical_size    Logical size of the field.
  3167.  
  3168.             physical_size   Physical size of the field.
  3169.  
  3170.             decimal_position    Virtual logical position of the decimal
  3171.                                 point.
  3172.  
  3173.     Comments    The values of these elements should not be directly changed.
  3174.  
  3175.     ________________________________________________________________________
  3176.  
  3177.     FIELD_POS
  3178.  
  3179.     Field Position Information
  3180.  
  3181.             The FIELD_POS structure contains information about a position in
  3182.             a field.
  3183.  
  3184.             typedef struct {
  3185.                 long selection;
  3186.                 int physical_position;
  3187.                 int logical_position;
  3188.                 BOOL to_right_of_dec;
  3189.                 LPSTR ppicture_str_pos;
  3190.  
  3191.  
  3192.                                       57   
  3193.                 int val_char_occ;
  3194.                 char validation_char;
  3195.             } FIELD_POS;
  3196.  
  3197.             The FIELD_POS structure contains the following elements:
  3198.  
  3199.             Element             Description
  3200.             -------             -----------
  3201.             selection           The field's selection.  The low-order word
  3202.                                 will always be equal to the high-order word.
  3203.  
  3204.             physical_position   The field's physical position.  The
  3205.                                 low-order and high-order words of selection
  3206.                                 are equal to this value.
  3207.  
  3208.             logical_position    The field's logical position.
  3209.  
  3210.             to_right_of_dec     Flag indicating whether the position is on
  3211.                                 the right-hand side of the decimal.
  3212.  
  3213.             ppicture_str_pos    Pointer to the position in the picture
  3214.                                 string that is associated with the position.
  3215.  
  3216.             val_char_occ        Validation character occurrence.  When there
  3217.                                 is multiple occurrence validation characters
  3218.                                 (such as "A(25)") in a field, the values for
  3219.                                 ppicture_str_pos and validation_char will
  3220.                                 remain the same regardless of which
  3221.                                 occurrence the position is at.  The
  3222.                                 val_char_occ identifies which occurrence the
  3223.                                 position is associated with.
  3224.  
  3225.             validation_char     The validation character.  See Appendix A
  3226.                                 for a list of possible values.
  3227.  
  3228.     ________________________________________________________________________
  3229.  
  3230.     FORM
  3231.  
  3232.     Form Record
  3233.  
  3234.             The FORM structure contains information about a form.
  3235.  
  3236.             typedef struct {
  3237.                 HWND hdlg;
  3238.                 HFORM hform;
  3239.                 HFORM hnext_form;
  3240.                 HFIELD hhead_field;
  3241.                 HFIELD hcurr_field;
  3242.                 HBUTTON hhead_button;
  3243.                 HANDLE hproc_array;
  3244.                 int num_controls;
  3245.                 LPSTR help_file_name;
  3246.  
  3247.  
  3248.                                       58   
  3249.                 int insert_id;
  3250.                 LPSTR insert_onmsg;
  3251.                 LPSTR insert_offmsg;
  3252.                 int capslock_id;
  3253.                 LPSTR capslock_onmsg;
  3254.                 LPSTR capslock_offmsg;
  3255.                 int numlock_id;
  3256.                 LPSTR numlock_onmsg;
  3257.                 LPSTR numlock_offmsg;
  3258.                 BOOL pressed_cancel;
  3259.                 BOOL error_condition;
  3260.                 BOOL ignore_ok;
  3261.                 BOOL edit_key_pressed;
  3262.                 BOOL just_passed_dec;
  3263.                 BOOL help_invoked;
  3264.             } FORM;
  3265.  
  3266.             The FORM structure contains the following elements:
  3267.  
  3268.             Element             Description
  3269.             -------             -----------
  3270.             hdlg                The window handle of the dialog box
  3271.                                 associated with the form.
  3272.  
  3273.             hform               Handle of the FORM data structure.
  3274.                                 (Self-reference)
  3275.  
  3276.             hnext_form          Handle of the next FORM data structure in
  3277.                                 the linked list of forms.
  3278.  
  3279.             hhead_field         Handle of the head FIELD structure in the
  3280.                                 linked list of fields.
  3281.  
  3282.             hcurr_field         Handle of the FIELD structure of the current
  3283.                                 field.
  3284.  
  3285.             hhead_button        Handle of the head BUTTON structure in the
  3286.                                 linked list of buttons.
  3287.  
  3288.             hproc_array         Handle of the memory block which contains
  3289.                                 the window procedure array that holds the
  3290.                                 window procedure addresses for each defined
  3291.                                 control.
  3292.  
  3293.             num_controls        Number of defined controls in the form.
  3294.  
  3295.             help_file_name      Pointer to the character string containing
  3296.                                 the help file name.
  3297.  
  3298.             insert_id           Dialog control ID of the static text control
  3299.                                 used for the Insert key status message.
  3300.  
  3301.             insert_onmsg        Pointer to the character string containing
  3302.  
  3303.  
  3304.                                       59   
  3305.                                 the message indicating the Insert key is on.
  3306.  
  3307.             insert_offmsg       Pointer to the character string containing
  3308.                                 the message indicating the Insert key is
  3309.                                 off.
  3310.  
  3311.             capslock_id         Dialog control ID of the static text control
  3312.                                 used for the CapsLock key status message.
  3313.  
  3314.             capslock_onmsg      Pointer to the character string containing
  3315.                                 the message indicating the CapsLock key is
  3316.                                 on.
  3317.  
  3318.             capslock_offmsg     Pointer to the character string containing
  3319.                                 the message indicating the CapsLock key is
  3320.                                 off.
  3321.  
  3322.             numlock_id          Dialog control ID of the static text control
  3323.                                 used for the NumLock key status message.
  3324.  
  3325.             numlock_onmsg       Pointer to the character string containing
  3326.                                 the message indicating the NumLock key is
  3327.                                 on.
  3328.  
  3329.             numlock_offmsg      Pointer to the character string containing
  3330.                                 the message indicating the NumLock key is
  3331.                                 off.
  3332.  
  3333.             pressed_cancel      Flag indicating whether the user pressed or
  3334.                                 clicked on the "Cancel" button.
  3335.  
  3336.             error_condition     Flag indicating whether the form is in an
  3337.                                 error condition. The form is in an error
  3338.                                 condition when a field fails validation.
  3339.  
  3340.             ignore_ok           Flag indicating whether the "OK" button or
  3341.                                 Enter key should be ignored.  Used with
  3342.                                 field validation.
  3343.  
  3344.             edit_key_pressed    Flag indicating whether the last key pressed
  3345.                                 was an editing key or a character key.
  3346.  
  3347.             just_passed_dec     Flag indicating whether the last keystroke
  3348.                                 moved the cursor from the position to the
  3349.                                 left of the decimal to the position to the
  3350.                                 right of the decimal.
  3351.  
  3352.             help_invoked        Flag indicating whether the Windows Help
  3353.                                 application has been invoked from within any
  3354.                                 of the defined controls.
  3355.  
  3356.     Comments    The values of these elements should not be directly changed.
  3357.  
  3358.  
  3359.  
  3360.                                       60   
  3361.     ________________________________________________________________________
  3362.  
  3363.     HBUTTON
  3364.  
  3365.     Handle of a BUTTON Structure
  3366.  
  3367.             typedef HANDLE HBUTTON;
  3368.  
  3369.     ________________________________________________________________________
  3370.  
  3371.     HFIELD
  3372.  
  3373.     Handle of a FIELD Structure
  3374.  
  3375.             typedef HANDLE HFIELD;
  3376.  
  3377.     ________________________________________________________________________
  3378.  
  3379.     HFORM
  3380.  
  3381.     Handle of a FORM Structure
  3382.  
  3383.             typedef HANDLE HFORM;
  3384.  
  3385.     ________________________________________________________________________
  3386.  
  3387.     HGENCTRL
  3388.  
  3389.     Handle of a Generic Control Record
  3390.  
  3391.             typedef HBUTTON HGENCTRL;
  3392.  
  3393.     Comments    The BUTTON data structure is used for storage of information
  3394.                 about a generic control.
  3395.  
  3396.     ________________________________________________________________________
  3397.  
  3398.     LPBUTTON
  3399.  
  3400.     Far Pointer to a BUTTON Structure
  3401.  
  3402.             typedef BUTTON FAR * LPBUTTON;
  3403.  
  3404.     ________________________________________________________________________
  3405.  
  3406.     LPFIELD
  3407.  
  3408.     Far Pointer to a FIELD Structure
  3409.  
  3410.             typedef FIELD FAR * LPFIELD;
  3411.  
  3412.     ________________________________________________________________________
  3413.  
  3414.  
  3415.  
  3416.                                       61   
  3417.     LPFIELD_POS
  3418.  
  3419.     Far Pointer to a FIELD_POS Structure
  3420.  
  3421.             typedef FIELD_POS FAR * LPFIELD_POS;
  3422.  
  3423.     ________________________________________________________________________
  3424.  
  3425.     LPFORM
  3426.  
  3427.     Far Pointer to a FORM Structure
  3428.  
  3429.             typedef FORM FAR * LPFORM;
  3430.  
  3431.     ________________________________________________________________________
  3432.  
  3433.     PBUTTON
  3434.  
  3435.     Pointer to a BUTTON Structure
  3436.  
  3437.             typedef BUTTON * PBUTTON;
  3438.  
  3439.     ________________________________________________________________________
  3440.  
  3441.     PFIELD
  3442.  
  3443.     Pointer to a FIELD Structure
  3444.  
  3445.             typedef FIELD * PFIELD;
  3446.  
  3447.     ________________________________________________________________________
  3448.  
  3449.     PFIELD_POS
  3450.  
  3451.     Pointer to a FIELD_POS Structure
  3452.  
  3453.             typedef FIELD_POS * PFIELD_POS;
  3454.  
  3455.     ________________________________________________________________________
  3456.  
  3457.     PFORM
  3458.  
  3459.     Pointer to a FORM Structure
  3460.  
  3461.             typedef FORM * PFORM;
  3462.  
  3463.     ________________________________________________________________________
  3464.  
  3465.     PROC_ARRAY_INFO
  3466.  
  3467.     Dialog Control Window Procedure Array Information
  3468.  
  3469.             The PROC_ARRAY_INFO structure is used to hold information about
  3470.  
  3471.  
  3472.                                       62   
  3473.             a dialog control's window procedure.
  3474.  
  3475.             typedef struct {
  3476.                 HWND hWnd;
  3477.                 FARPROC lpProc;
  3478.             } PROC_ARRAY_INFO;
  3479.  
  3480.             The PROC_ARRAY_INFO structure contains the following elements:
  3481.  
  3482.             Element     Description
  3483.             -------     -----------
  3484.             hWnd        The window handle of the dialog control.
  3485.  
  3486.             lpProc      Pointer to the dialog control's window procedure.
  3487.  
  3488.     Comments    The window procedure array is not accessible.  This data
  3489.                 structure is listed solely because it appears in the library
  3490.                 header file.
  3491.  
  3492.  
  3493.  
  3494.  
  3495.  
  3496.  
  3497.  
  3498.  
  3499.  
  3500.  
  3501.  
  3502.  
  3503.  
  3504.  
  3505.  
  3506.  
  3507.  
  3508.  
  3509.  
  3510.  
  3511.  
  3512.  
  3513.  
  3514.  
  3515.  
  3516.  
  3517.  
  3518.  
  3519.  
  3520.  
  3521.  
  3522.  
  3523.  
  3524.  
  3525.  
  3526.  
  3527.  
  3528.                                       63   
  3529.  
  3530.     Appendix A:  Picture String Characters
  3531.  
  3532.  
  3533.     Character       Meaning
  3534.     ---------       -------
  3535.     9               Accept an integer numeric character (0 - 9).
  3536.  
  3537.     #               Accept a real numeric character (0 - 9, -, +, ., E, e).
  3538.  
  3539.     A               Accept an alphabetic character (A - Z, a - z).  Foreign
  3540.                     alphabetic characters are supported.
  3541.  
  3542.     X               Accept an alphanumeric character (A - Z, a - z, 0 - 9).
  3543.                     Foreign alphabetic characters are supported.
  3544.  
  3545.     Y               Accept a yes/no character (Y, y, N, n).
  3546.  
  3547.     D               Accept a date character (0 - 9, -, /).
  3548.  
  3549.     T               Accept a telephone number character (0 - 9, (, ), -, +).
  3550.  
  3551.     F               Accept a file name character (any character except \, :,
  3552.                     *, ?, ;, ,, =, +, <, >, |, /, [, ], ").
  3553.  
  3554.     P               Accept a pathspec character (any character except ;, ,,
  3555.                     =, +, <, >, |, /, [, ], ").
  3556.  
  3557.     ?               Accept any printable character.
  3558.  
  3559.     !               Accept any printable character.  If the character is a
  3560.                     lowercase letter, convert it to uppercase.  Foreign
  3561.                     alphabetic characters are supported.
  3562.  
  3563.     < ..... >       Accept only one of the characters listed between the
  3564.                     angle brackets. For example, "<0123>" will accept only
  3565.                     0, 1, 2, or 3.  Also you can specify a range using two
  3566.                     periods between the two range limiting characters.  For
  3567.                     example, "<0..3>" would be equivalent to "<0123>".  Or
  3568.                     you can get fancy, "<0..3>5<7..9>" would accept 0, 1, 2,
  3569.                     3, 5, 7, 8, or 9. Characters are converted to uppercase.
  3570.                     For example, "<A..Z>" will accept any uppercase or
  3571.                     lowercase letter.
  3572.  
  3573.     > ..... <       Accept any character except the ones listed between the
  3574.                     angle brackets.  Works similar to the "<.....>"
  3575.                     characters.
  3576.  
  3577.     ( ..... )       Specifies multiple occurrences of one of the above
  3578.                     validation characters.  For example, "A(5)" is
  3579.                     equivalent to "AAAAA". "<0123>(3)" is equivalent to
  3580.                     "<0123><0123><0123>".  The open parenthesis must
  3581.                     immediately follow the validation character.
  3582.  
  3583.  
  3584.                                       64   
  3585.  
  3586.     ' ..... '       Insert formatting characters into field.  All characters
  3587.                     between the single quotes are formatting characters.
  3588.  
  3589.     \" ..... \"     Double quotes have the meaning as single quotes.  Useful
  3590.                     for when you need to insert formatting characters that
  3591.                     include the single quote character.  Note in the C
  3592.                     programming language, the backslashes preceding the
  3593.                     double quote characters are required.
  3594.  
  3595.     .               Special formatting character which specifies where the
  3596.                     decimal point will be in a numeric field.  You can only
  3597.                     have one decimal point in a picture string.  The field
  3598.                     must have either the FDF_NUMERIC or FDF_CALCNUM feature
  3599.                     defined.
  3600.  
  3601.     ,               Special formatting character which specifies where
  3602.                     conditional commas will be located in a calculator-style
  3603.                     numeric field.  A comma will only be displayed if a
  3604.                     digit exists to the left of it.  The field must have the
  3605.                     FDF_CALCNUM feature defined.
  3606.  
  3607.     space           The space character can be used throughout the picture
  3608.                     string to improve readability.  Do not put spaces
  3609.                     between angle brackets or quotes unless you intend for
  3610.                     them to be there.
  3611.  
  3612.  
  3613.  
  3614.  
  3615.  
  3616.  
  3617.  
  3618.  
  3619.  
  3620.  
  3621.  
  3622.  
  3623.  
  3624.  
  3625.  
  3626.  
  3627.  
  3628.  
  3629.  
  3630.  
  3631.  
  3632.  
  3633.  
  3634.  
  3635.  
  3636.  
  3637.  
  3638.  
  3639.  
  3640.                                       65   
  3641.  
  3642.     Appendix B:  Field Editing Keys
  3643.  
  3644.  
  3645.                               CURSOR MOVEMENT
  3646.  
  3647.     Editing Key         Action
  3648.     -----------         ------
  3649.     LeftArrow           Moves the cursor to the previous position.
  3650.  
  3651.     RightArrow          Moves the cursor to the next position.
  3652.  
  3653.     Ctrl-LeftArrow      Moves the cursor to the beginning of the previous
  3654.                         word.
  3655.  
  3656.     Ctrl-RightArrow     Moves the cursor to the beginning of the next word.
  3657.  
  3658.     Home                Moves the cursor to the first position in the field.
  3659.  
  3660.     End                 Moves the cursor to the position following the last
  3661.                         character in the field.
  3662.  
  3663.     Ctrl-End            Move the cursor to the last position in the field.
  3664.  
  3665.  
  3666.                               TEXT DELETION
  3667.  
  3668.     Editing Key         Action
  3669.     -----------         ------
  3670.     Backspace           Deletes the character to the left of the cursor.
  3671.  
  3672.     Delete              Deletes the character at the cursor.
  3673.  
  3674.     Ctrl-Backspace      Deletes the word to the left of the cursor.
  3675.  
  3676.     Ctrl-Delete         Deletes the word at the cursor.
  3677.  
  3678.     Ctrl-Shift-Delete   Deletes all characters to the right of the cursor.
  3679.  
  3680.  
  3681.  
  3682.                                   CLIPBOARD
  3683.  
  3684.     Editing Key         Action
  3685.     -----------         ------
  3686.     Ctrl-Insert         Copies the contents of field to the clipboard.
  3687.  
  3688.     Shift-Insert        Pastes the contents of the clipboard into the field.
  3689.  
  3690.     Shift-Delete        Cuts the contents of the field to the clipboard.
  3691.  
  3692.  
  3693.                                   TOGGLES
  3694.  
  3695.  
  3696.                                       66   
  3697.  
  3698.     Editing Key         Action
  3699.     -----------         ------
  3700.     Insert              Toggles Insert mode.
  3701.  
  3702.     CapsLock            Toggles Caps Lock mode.
  3703.  
  3704.     NumLock             Toggles Num Lock mode.
  3705.  
  3706.  
  3707.                                 MISCELLANEOUS
  3708.  
  3709.     Editing Key         Action
  3710.     -----------         ------
  3711.     Enter               Terminates processing of the form.  Field changes
  3712.                         are saved.
  3713.  
  3714.     Esc                 Terminates processing of the form.  None of the
  3715.                         field changes will be saved.
  3716.  
  3717.     Tab                 Sets the input focus to the next dialog control with
  3718.                         the WS_TABSTOP style.
  3719.  
  3720.     Shift-Tab           Sets the input focus to the previous dialog control
  3721.                         with the WS_TABSTOP style.
  3722.  
  3723.     Alt-Backspace       Restores the field to its previous contents.
  3724.  
  3725.     F1                  Displays context-sensitive help for the field.
  3726.  
  3727.  
  3728.  
  3729.  
  3730.  
  3731.  
  3732.  
  3733.  
  3734.  
  3735.  
  3736.  
  3737.  
  3738.  
  3739.  
  3740.  
  3741.  
  3742.  
  3743.  
  3744.  
  3745.  
  3746.  
  3747.  
  3748.  
  3749.  
  3750.  
  3751.  
  3752.                                       67   
  3753.  
  3754.  
  3755.     Appendix C:  Glossary
  3756.  
  3757.  
  3758.     button
  3759.         A button is a dialog box button control with an on and off state
  3760.         defined by the button_define function.  The button control is
  3761.         usually a radio button or check box.
  3762.  
  3763.     button control
  3764.         A button control is a Windows dialog control that can be set either
  3765.         on or off.  A button control is actually a window of class "button"
  3766.         and is a child of the dialog box window.
  3767.  
  3768.     cursor
  3769.         The cursor is the blinking vertical bar that identifies the user's
  3770.         position in a field. Throughout the Windows SDK documentation, the
  3771.         term "cursor" refers to the mouse pointer and the term "caret"
  3772.         refers to the cursor.
  3773.  
  3774.     edit control
  3775.         An edit control is a Windows dialog control that is used for the
  3776.         input of text information by the user.  An edit control is actually
  3777.         a window of class "edit" and is a child of the dialog box window.
  3778.  
  3779.     edit field
  3780.         Another name for an edit control.
  3781.  
  3782.     field
  3783.         A field is a dialog box edit control that has been defined by the
  3784.         field_define function.
  3785.  
  3786.     form
  3787.         A form is a dialog box with one or more WEDL-defined controls within
  3788.         it.
  3789.  
  3790.     formatting characters
  3791.         Formatting characters are the characters embedded in a field to
  3792.         assist the user in entering the correct data.  The positions of the
  3793.         formatting characters in a field are defined in the picture string.
  3794.         The user is not able to move the cursor to, or edit, the formatting
  3795.         characters. The '/' characters in a date field, and the '(', ')',
  3796.         and '-' characters in a phone number field are good examples of
  3797.         formatting characters.
  3798.  
  3799.     generic control
  3800.         A generic control can be any control in a dialog box defined by the
  3801.         genctrl_define function.
  3802.  
  3803.     logical field contents
  3804.         The logical field contents are the contents of a field without the
  3805.         embedded formatting characters.  To get the logical contents of a
  3806.  
  3807.  
  3808.                                       68   
  3809.         field, call the field_get_text function.
  3810.  
  3811.     logical field format
  3812.         A character string is in logical field format if it contains no
  3813.         embedded formatting characters and it can be used to set the
  3814.         contents of a field.  You can set the contents of a field using a
  3815.         character string in logical field format by calling the
  3816.         field_set_text function.
  3817.  
  3818.     mouse pointer
  3819.         The mouse pointer is the icon on the screen that identifies where
  3820.         the mouse currently is.  This icon is very often a white arrow, but
  3821.         can have just about any shape. Throughout the Windows SDK, the term
  3822.         "cursor" refers to the mouse pointer.
  3823.  
  3824.     physical field contents
  3825.         The physical field contents are the contents of a field including
  3826.         the embedded formatting characters.  If you were to call
  3827.         GetDlgItemText on the field, you would get its physical contents,
  3828.         but it is preferable to use the field_get_text function.
  3829.  
  3830.     physical field format
  3831.         A character string is in physical field format if it contains any
  3832.         embedded formatting characters and it can be used to set the
  3833.         contents of a field.  You can set the contents of a field using a
  3834.         character string in physical field format by calling the
  3835.         field_set_text function.
  3836.  
  3837.     picture string
  3838.         The picture string is a character string assigned to a field by the
  3839.         field_define function.  It is used to define the number of
  3840.         characters in a field, the allowable characters for each position in
  3841.         the field (validation characters), and the placement of formatting
  3842.         characters.  See Appendix A for a list of characters that can exist
  3843.         in a picture string.
  3844.  
  3845.     validation character
  3846.         A validation character is a character in a picture string which is
  3847.         used to define the allowable characters that can be input for the
  3848.         corresponding position in its field.  See Appendix A for a list of
  3849.         validation characters.
  3850.  
  3851.     validation function
  3852.         A validation function is a function written by the programmer to
  3853.         validate the information in a field.  A validation function is
  3854.         assigned to a field by the field_define function.
  3855.  
  3856.  
  3857.  
  3858.  
  3859.  
  3860.  
  3861.  
  3862.  
  3863.  
  3864.                                       69   
  3865.